[Bug c/101474] New: -fipa-icf generates worse code for identical function

2021-07-16 Thread vegard.nossum at oracle dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101474

Bug ID: 101474
   Summary: -fipa-icf generates worse code for identical function
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
  Target Milestone: ---

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

I've come across a weird behaviour when using -fipa-icf, could maybe be related
to bug 80277.

Build with -O1 -fipa-icf and the second version of the identical function
actually has worse codegen than if you have just one of them there or than if
you hadn't passed -fipa-icf at all.

See example: https://godbolt.org/z/n8zz947aK

[Bug c++/84651] internal compiler error: in pop_local_binding, at cp/name-lookup.c:2054

2019-11-18 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84651

Vegard Nossum  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #3 from Vegard Nossum  ---
This bug seems to have been fixed in 9.x, 8.x, and 7.x, but is broken again
with g++ (Compiler-Explorer-Build) 10.0.0 20191117 (experimental)

[Bug c++/84655] internal compiler error: unexpected expression 'a' of kind template_parm_index

2019-11-16 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84655

Vegard Nossum  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #5 from Vegard Nossum  ---
I can't seem to reproduce this anymore, I suppose it could be closed.

[Bug c++/84974] [8 Regression] ICE: Segmentation fault (ovl_first()/location_of())

2019-11-16 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84974

--- Comment #7 from Vegard Nossum  ---
This seems to be fixed in 8.{1,2,3}, is there any reason to keep this bug open?

[Bug inline-asm/84966] ICE verify_gimple failed (verify_gimple_in_cfg())

2019-11-16 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84966

--- Comment #2 from Vegard Nossum  ---
This seems to be fixed in g++ (Compiler-Explorer-Build) 10.0.0 20191115
(experimental).

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

2019-11-16 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84965

--- Comment #2 from Vegard Nossum  ---
This seems to be fixed in g++ (Compiler-Explorer-Build) 10.0.0 20191115
(experimental).

[Bug c++/85016] internal compiler error: side-effects element in no-side-effects CONSTRUCTOR

2019-11-16 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85016

--- Comment #2 from Vegard Nossum  ---
This no longer crashes on g++ (Compiler-Explorer-Build) 10.0.0 20191115
(experimental)

[Bug c++/84976] ICE: Segmentation fault (cp_build_modify_expr())

2019-11-16 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84976

--- Comment #2 from Vegard Nossum  ---
This bug was somehow fixed in 9.2.0 but segfaults again on
(Compiler-Explorer-Build) 10.0.0 20191115 (experimental).

[Bug inline-asm/84680] [8/9/10 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2019-11-14 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84680

Vegard Nossum  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #5 from Vegard Nossum  ---
This seems to be fixed in 8.1.

[Bug rtl-optimization/90209] codegen regression (x < 0 ? -x : x) results in branch instead of single instruction on x86_64

2019-04-23 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90209

Vegard Nossum  changed:

   What|Removed |Added

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

--- Comment #2 from Vegard Nossum  ---
x < 0 will be false for x == -0. and therefore the return value will be -0.,
which it won't be with just the "andpd". Closing as invalid

[Bug rtl-optimization/90209] New: codegen regression (x < 0 ? -x : x) results in branch instead of single instruction on x86_64

2019-04-23 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90209

Bug ID: 90209
   Summary: codegen regression (x < 0 ? -x : x) results in branch
instead of single instruction on x86_64
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
  Target Milestone: ---

This test case:

double abs1(double x) {
return x < 0 ? -x : x;
}

used to generate just a single "andpd" instruction before r131381
(5921cbdff68):

abs1:
andpd   .LC2(%rip), %xmm0
ret

afterward this revision, it generated this:

fabs1:
movapd  %xmm0, %xmm1
ucomisd .LC0(%rip), %xmm0
jb  .L7
.L2:
movapd  %xmm1, %xmm0
ret
.L7:
jp  .L2
movsd   .LC1(%rip), %xmm0
xorpd   %xmm0, %xmm1
movapd  %xmm1, %xmm0
ret

The branch is still present on trunk, as can be seen here:

https://godbolt.org/z/P4tQMB

Thanks to jakub for narrowing it down to r131375..r131425.

Three related bugs (AFAICT) are #29253, #62055, and #64897.

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-09-25 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Vegard Nossum  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #12 from Vegard Nossum  ---
(In reply to Nathan Sidwell from comment #11)
> Fixed trunk & gcc8

I just retried this test case and wanted to note that trunk does not warn and
does not give an error, whereas gcc 8.2 gives an error. Is that the
correct/intended behaviour?

[Bug tree-optimization/85390] New: possible missed optimisation / regression from 6.3 with conditional expression

2018-04-13 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85390

Bug ID: 85390
   Summary: possible missed optimisation / regression from 6.3
with conditional expression
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
  Target Milestone: ---

Input:

extern int a, b, c;

int f(int x)
{
__builtin_prefetch((void *) (x ? a : b));
return c;
}

Current trunk with -O3 produces this:

f(int):
  testl %edi, %edi
  je .L2
  movslq a(%rip), %rax
  prefetcht0 (%rax)
  movl c(%rip), %eax
  ret
.L2:
  movslq b(%rip), %rax
  prefetcht0 (%rax)
  movl c(%rip), %eax
  ret

While 6.3.0 did not have a branch:

f(int):
  movslq a(%rip), %rdx
  movslq b(%rip), %rax
  testl %edi, %edi
  cmovne %rdx, %rax
  prefetcht0 (%rax)
  movl c(%rip), %eax
  ret

For reference, clang also outputs a branchless (but slightly longer) version:

f(int): # @f(int)
  testl %edi, %edi
  movl $a, %eax
  movl $b, %ecx
  cmovneq %rax, %rcx
  movslq (%rcx), %rax
  prefetcht0 (%rax)
  movl c(%rip), %eax
  retq

In my tests, the 6.3.0 code is equally fast in the x == 0 and x != 0 cases,
whereas trunk/8.0.1 is only half as fast as 6.3.0 in the x == 0 (branch taken)
case. In the branch not taken case, the 8.0.1 code has the same speed as the
6.3.0 code.

[Bug tree-optimization/85375] New: possible missed optimisation / regression from 6.3 with while (__builtin_ffs(x) && x)

2018-04-12 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85375

Bug ID: 85375
   Summary: possible missed optimisation / regression from 6.3
with while (__builtin_ffs(x) && x)
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
  Target Milestone: ---

Input:

extern int a;

int f(int x)
{
while (__builtin_ffs(x) && x)
x -= a;

return x;
}

gcc 6.3.0 with -O3 compiled this as:

f(int):
  movl %edi, %eax
  movl a(%rip), %esi
  movl $-1, %ecx
  jmp .L3
.L11:
  testl %eax, %eax
  je .L2
  subl %esi, %eax
.L3:
  bsfl %eax, %edx
  cmove %ecx, %edx
  cmpl $-1, %edx
  jne .L11
.L2:
  rep ret

whereas current trunk (also with -O3) compiles it as:

f(int):
  movl $-1, %ecx
  bsfl %edi, %eax
  cmove %ecx, %eax
  cmpl %ecx, %eax
  je .L5
  testl %edi, %edi
  je .L6
  movl a(%rip), %esi
  movl %edi, %eax
  jmp .L3
.L4:
  testl %eax, %eax
  je .L1
.L3:
  subl %esi, %eax
  bsfl %eax, %edx
  cmove %ecx, %edx
  cmpl $-1, %edx
  jne .L4
  ret
.L6:
  xorl %eax, %eax
.L1:
  ret
.L5:
  movl %edi, %eax
  ret

There are fewer instructions overall for the case where x is 0 on entry, but
trunk still has longer code overall even if we change the while-condition to
__builtin_expect(!!__builtin_ffs(x) && x, 1) which ideally should pessimise
this case.

For the same input, clang trunk with -O3 gives:

f(int): # @f(int)
  test edi, edi
  je .LBB0_3
  mov eax, dword ptr [rip + a]
  neg edi
.LBB0_2: # =>This Inner Loop Header: Depth=1
  add edi, eax
  jne .LBB0_2
.LBB0_3:
  xor eax, eax
  ret

This seems to rely simply on the fact that (__builtin_ffs(x) == 0) and (x == 0)
are equivalent.

If you simplify the while-condition to simply __builtin_ffs(x), then the
difference is smaller but still there:

6.3.0:

f(int):
  movl %edi, %eax
  movl a(%rip), %esi
  movl $-1, %ecx
  jmp .L3
.L5:
  subl %esi, %eax
.L3:
  bsfl %eax, %edx
  cmove %ecx, %edx
  cmpl $-1, %edx
  jne .L5
  rep ret

trunk:

f(int):
  movl $-1, %ecx
  bsfl %edi, %eax
  cmove %ecx, %eax
  cmpl %ecx, %eax
  je .L4
  movl a(%rip), %esi
  movl %edi, %eax
.L3:
  subl %esi, %eax
  bsfl %eax, %edx
  cmove %ecx, %edx
  cmpl $-1, %edx
  jne .L3
  ret
.L4:
  movl %edi, %eax
  ret

[Bug rtl-optimization/85315] New: missed optimisation opportunity for derefences

2018-04-10 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85315

Bug ID: 85315
   Summary: missed optimisation opportunity for derefences
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
  Target Milestone: ---

Input:

extern int x;
extern int a;
extern int b;

int f()
{
int y = x;
return *( + (a + b));
}

With -O3, trunk outputs:

f():
  movl x(%rip), %eax
  movl %eax, -4(%rsp)
  movl b(%rip), %eax
  addl a(%rip), %eax
  cltq
  movl -4(%rsp,%rax,4), %eax
  ret

Clang, on the other hand, infers that (a + b) == 0:

f(): # @f()
  movl x(%rip), %eax
  retq

From richi on IRC:

"""
we don't do this kind of optimization at the moment
a related one would be to place a if (a+b != 0) link_error (); after the memory
access
similarly for array accesses an if (i not-in-range) link_error ()
thus, we do not derive ranges for address-computation parts [at dereference
sites]
"""

[Bug rtl-optimization/85237] New: missed optimisation opportunity for large/negative shifts

2018-04-05 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85237

Bug ID: 85237
   Summary: missed optimisation opportunity for large/negative
shifts
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: segher at gcc dot gnu.org
  Target Milestone: ---

Input:

int f(int x)
{
return 100 >> (1 * (x == 1));
}

With -O3 I get:

f(int):
  cmpl $1, %edi
  movl $100, %edx
  movl $0, %eax
  cmovne %edx, %eax
  ret

However, (x == 1) must always be 0, since the shift would be too large (and
cause UB) otherwise. Clang is able to see this and always outputs:

f(int): # @f(int)
  movl $100, %eax
  retq

I believe a similar example would be simply:

int f(int x)
{
return 100 >> (INT_MAX * x);
}

where again, the only valid (non-UB) value for x is 0.

[Bug target/85234] New: missed optimisation opportunity for (~x >> n) ? a : b with n, a, b constants

2018-04-05 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85234

Bug ID: 85234
   Summary: missed optimisation opportunity for (~x >> n) ? a : b
with n, a, b constants
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: segher at gcc dot gnu.org
  Target Milestone: ---
Target: x86_64-*-*, i?86-*-*

Input:

int x;

int f()
{
return (~x >> 3) ? 1030355390 : 1367354703;
}

With -O3, trunk outputs:

f():
  movl x(%rip), %eax
  notl %eax
  sarl $3, %eax
  cmpl $1, %eax
  sbbl %eax, %eax
  andl $336999313, %eax
  addl $1030355390, %eax
  ret

Clang (also at -O3), however, outputs:

f(): # @f()
  cmpl $-8, x(%rip)
  movl $1030355390, %ecx # imm = 0x3D69F9BE
  movl $1367354703, %eax # imm = 0x51802D4F
  cmovbl %ecx, %eax
  retq

[Bug target/85224] New: x86_64 missed optimisation opportunity for (-1 * !!x)

2018-04-05 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85224

Bug ID: 85224
   Summary: x86_64 missed optimisation opportunity for (-1 * !!x)
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
  Target Milestone: ---

Input:

int f(int x) {
  return -1 * !!x;
}

Trunk with -O3 gives:

f(int):
  xor eax, eax
  test edi, edi
  setne al
  neg eax
  ret

While clang -O3 gives:

f: # @f
  neg edi
  sbb eax, eax
  ret

gcc -O1 gives a different sequence which is slightly longer:

f(int):
  test edi, edi
  setne al
  movzx eax, al
  neg eax
  ret

[Bug sanitizer/85213] New: -fsanitize=undefined internal compiler error: in fold_convert_loc, at fold-const.c:2402

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

Bug ID: 85213
   Summary: -fsanitize=undefined internal compiler error: in
fold_convert_loc, at fold-const.c:2402
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Input (valid AFAICT):

int f(int x) {
  return (__builtin_expect(({ x != 0; }) ? 0 : 1, 3) == 0) * -1 << 0;
}

Output:

$ cc1plus -O1 -fsanitize=undefined -g
 int f(int)
Analyzing compilation unit

output/ice-fold_covert_loc.cc:2:27: internal compiler error: in
fold_convert_loc, at fold-const.c:2402
   return (__builtin_expect(({ x != 0; }) ? 0 : 1, 3) == 0) * -1 << 0;
   ^~
0x1fb2e1b fold_convert_loc(unsigned int, tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/fold-const.c:2401
0x227d824 gimplify_cond_expr
/home/vegard/git/gcc/gcc/gimplify.c:4034
0x222a3a6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11391
0x2236ae1 gimplify_stmt(tree_node**, gimple**)
/home/vegard/git/gcc/gcc/gimplify.c:6658
0x227cfbe gimplify_cond_expr
/home/vegard/git/gcc/gcc/gimplify.c:4022
0x222a3a6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11391
0x225b10c gimplify_expr
/home/vegard/git/gcc/gcc/gimplify.c:12430
0x22606a8 gimplify_arg(tree_node**, gimple**, unsigned int, bool)
/home/vegard/git/gcc/gcc/gimplify.c:3176
0x2262d8b gimplify_call_expr
/home/vegard/git/gcc/gcc/gimplify.c:3382
0x222936f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11406
0x2227a92 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:12159
0x22234a7 internal_get_tmp_var
/home/vegard/git/gcc/gcc/gimplify.c:575
0x222e2e0 get_initialized_tmp_var(tree_node*, gimple**, gimple**, bool)
/home/vegard/git/gcc/gcc/gimplify.c:628
0x222e2e0 gimplify_save_expr
/home/vegard/git/gcc/gcc/gimplify.c:5931
0x222e2e0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11734
0x2227a92 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:12159
0x2227ac0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:12161
0x227d943 gimplify_cond_expr
/home/vegard/git/gcc/gcc/gimplify.c:4063
0x222a3a6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11391
0x227c58d gimplify_stmt(tree_node**, gimple**)
/home/vegard/git/gcc/gcc/gimplify.c:6658
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Built from r259106.

Test case was minimised by C-Reduce.

It seems -fsanitize=shift is enough to trigger it. The shift is by 0, though,
so it should be valid (even though the shifted value is potentially negative).

7.3.0 seems to accept it just fine.

[Bug inline-asm/85172] New: internal compiler error: unexpected expression '' of kind asm_expr

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

Bug ID: 85172
   Summary: internal compiler error: unexpected expression
'' of kind asm_expr
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: inline-asm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
  Target Milestone: ---

Input (valid code AFAICT):

int f() {
  return !__builtin_constant_p(({
asm("");
0;
  }));
}

Output:

$ cc1plus
 int f()
output/unexpected-expression.cc:5:5: internal compiler error: unexpected
expression '' of kind asm_expr
   }));
 ^
0xa38827 cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4786
0xa31d62 cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4423
0xa306a3 cxx_eval_statement_list
/home/vegard/git/gcc/gcc/cp/constexpr.c:3922
0xa306a3 cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4670
0xa5bc38 cxx_eval_builtin_function_call
/home/vegard/git/gcc/gcc/cp/constexpr.c:1189
0xa24598 cxx_eval_call_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:1496
0xa31c70 cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4200
0xa4b8ca cxx_eval_outermost_constant_expr
/home/vegard/git/gcc/gcc/cp/constexpr.c:4846
0xa591b6 maybe_constant_value(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/constexpr.c:5063
0xab906a cp_fully_fold(tree_node*)
/home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2071
0x13da147 cp_build_binary_op(unsigned int, tree_code, tree_node*, tree_node*,
int)
/home/vegard/git/gcc/gcc/cp/typeck.c:5391
0xae49c7 ocp_convert(tree_node*, tree_node*, int, int, int)
/home/vegard/git/gcc/gcc/cp/cvt.c:812
0xaec6ac cp_convert(tree_node*, tree_node*, int)
/home/vegard/git/gcc/gcc/cp/cvt.c:623
0xaec6ac cp_convert_and_check(tree_node*, tree_node*, int)
/home/vegard/git/gcc/gcc/cp/cvt.c:642
0x8e068f convert_like_real
/home/vegard/git/gcc/gcc/cp/call.c:7116
0x8e5c29 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
/home/vegard/git/gcc/gcc/cp/call.c:10669
0x13c91f8 cp_build_unary_op(tree_code, tree_node*, bool, int)
/home/vegard/git/gcc/gcc/cp/typeck.c:6148
0x94399b build_new_op_1
/home/vegard/git/gcc/gcc/cp/call.c:6026
0x946036 build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
/home/vegard/git/gcc/gcc/cp/call.c:6058
0x13d000c build_x_unary_op(unsigned int, tree_code, cp_expr, int)
/home/vegard/git/gcc/gcc/cp/typeck.c:5601
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

6.3.0 generates code for "return 1", i.e. __builtin_constant_p() on an
expression containing an empty asm() returned 0 (which seems sensible, as I
don't think gcc should know anything about what is inside the asm string).

7.1.0 ICEs as well.

Test case was minimised by C-Reduce.

[Bug c++/85156] New: -O1 -g internal compiler error: gimplification failed

2018-04-02 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85156

Bug ID: 85156
   Summary: -O1 -g internal compiler error: gimplification failed
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-valid-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 (valid code AFAICT):

int a, b;

int f()
{
  return __builtin_expect(a ? b != 0 : 0, ({ 1; }));
}

Output:

$ cc1plus -O1 -g
 int f()
Analyzing compilation unit
gimplification failed:
 >
head (nil) tail (nil) stmts
>

output/gimplification-failed.cc:5:26: internal compiler error: gimplification
failed
   return __builtin_expect(a ? b != 0 : 0, ({ 1; }));
  ^~
0x222d153 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:12395
0x22252a5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11377
0x22584ec gimplify_expr
/home/vegard/git/gcc/gcc/gimplify.c:12432
0x225de68 gimplify_arg(tree_node**, gimple**, unsigned int, bool)
/home/vegard/git/gcc/gcc/gimplify.c:3179
0x225fe07 gimplify_call_expr
/home/vegard/git/gcc/gcc/gimplify.c:3385
0x22264bf gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11408
0x2224be2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:12161
0x227b353 gimplify_cond_expr
/home/vegard/git/gcc/gcc/gimplify.c:4066
0x222753a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11393
0x2234081 gimplify_stmt(tree_node**, gimple**)
/home/vegard/git/gcc/gcc/gimplify.c:6660
0x22278eb gimplify_statement_list
/home/vegard/git/gcc/gcc/gimplify.c:1767
0x22278eb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11865
0x2234081 gimplify_stmt(tree_node**, gimple**)
/home/vegard/git/gcc/gcc/gimplify.c:6660
0x227c1bc gimplify_cond_expr
/home/vegard/git/gcc/gcc/gimplify.c:4054
0x222753a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11393
0x2234081 gimplify_stmt(tree_node**, gimple**)
/home/vegard/git/gcc/gcc/gimplify.c:6660
0x227a9ce gimplify_cond_expr
/home/vegard/git/gcc/gcc/gimplify.c:4025
0x222753a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11393
0x2281d9c gimplify_modify_expr
/home/vegard/git/gcc/gcc/gimplify.c:5628
0x2226d66 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/home/vegard/git/gcc/gcc/gimplify.c:11437

Test case was minimised by C-Reduce, it seems both -O1 and -g are necessary for
the ICE. Clang is fine with it, and 7.3.0 seems fine with it as well.

[Bug c++/85046] New: cp/name-lookup.c:6175:53: runtime error: member access within null pointer of type 'struct cp_binding_level'

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

Bug ID: 85046
   Summary: cp/name-lookup.c:6175:53: runtime error: member access
within null pointer of type 'struct cp_binding_level'
   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 c() {
  {
auto f(__builtin_offsetof(
struct {
  void g();
  int f;
  struct h {
union g enum g {} enum e { a, b };
e ginline() {
  enum g {};
  asm goto("" : : : : d);
  return a;
d:
  return b;
}
  };
},
f));
asm(""
: "=d"(f)
: ""(__builtin_object_size(__builtin_offsetof(
   struct {
 int f;
 struct {};
 struct {
 } i;
   },
   f),
   __builtin_extend_pointer({};
[] {};
struct j {
  enum e { b };
  e k() {
asm goto("" : : : : d);
try {
} catch (int l) {
  struct m;
  struct n;
}
  d:
return b;
class g {
  int g;
};
  }
  g o();
};
  }
  struct g;
}

Output:

$ cc1plus 
 void c()
:8:45: error: multiple types in one declaration
 c()h::e c()h::ginline()
c()::<lambda()> static void c()::<lambda()>::_FUN() c()::<lambda()>::operator
void (*)()() const c()::j::e
c()::j::k()/home/vegard/git/gcc/gcc/cp/name-lookup.c:6175:53: runtime error:
member access within null pointer of type 'struct cp_binding_level'
ASAN:SIGSEGV
=
==5446==ERROR: AddressSanitizer: SEGV on unknown address 0x0030 (pc
0x038d5b44 bp 0x7fea893a1040 sp 0x7ffd56aadc50 T0)
#0 0x38d5b43 in lookup_type_scope_1
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6175
#1 0x38d5b43 in lookup_type_scope(tree_node*, tag_scope)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6240
#2 0x25fb0cd in lookup_and_check_tag
/home/vegard/git/gcc/gcc/cp/decl.c:13582
#3 0x2602936 in xref_tag_1 /home/vegard/git/gcc/gcc/cp/decl.c:13696
#4 0x2602936 in xref_tag(tag_types, tree_node*, tag_scope, bool)
/home/vegard/git/gcc/gcc/cp/decl.c:13818
#5 0x3f23b08 in cp_parser_elaborated_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17920
#6 0x3d1beb4 in cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16804
#7 0x3f3fdff in cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13631
#8 0x406701d in cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12940
#9 0x408425b in cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12885
#10 0x409572f in cp_parser_declaration_statement
/home/vegard/git/gcc/gcc/cp/parser.c:12478
#11 0x3c88eb7 in cp_parser_statement
/home/vegard/git/gcc/gcc/cp/parser.c:10927
#12 0x3cad953 in cp_parser_statement_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:11276
#13 0x3cbdaf1 in cp_parser_compound_statement
/home/vegard/git/gcc/gcc/cp/parser.c:11230
#14 0x3f962a8 in cp_parser_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21792
#15 0x3f962a8 in cp_parser_ctor_initializer_opt_and_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21827
#16 0x3fc3219 in cp_parser_function_definition_after_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26842
#17 0x403cdf5 in
cp_parser_function_definition_from_specifiers_and_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26759
#18 0x403cdf5 in cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19504
#19 0x4069481 in cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13067
#20 0x408425b in cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12885
#21 0x41bb8ee in cp_parser_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12782
#22 0x4188c5f in cp_parser_declaration_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:12658
#23 0x419308b in cp_parser_translation_unit
/home/vegard/git/gcc/gcc/cp/parser.c:4563
#24 0x419308b in c_parse_file() /home/vegard/git/gcc/gcc/cp/parser.c:39019
#25 0x613101d in c_common_parse_file()
/home/vegard/git/gcc/gcc/c-family/c-opts.c:1132
#26 0x10cb4551 in compile_file /home/vegard/git/gcc/gcc/toplev.c:455
#27 0x14c07ed in do_compile /home/vegard/git/gcc/gcc/toplev.c:2132
#28 0x14

[Bug c++/84705] [6/7/8 Regression] internal compiler error: in add_stmt, at cp/semantics.c:390

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

Vegard Nossum  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #3 from Vegard Nossum  ---
Slightly different test case + maybe a bit more info from asan:

template  struct d {
  short : 1e31 || [] {
struct b {
  int a = const_cast < struct c;
};
  };
};

$ cc1plus 
 d< >::<lambda()>/home/vegard/git/gcc/gcc/cp/semantics.c:390:3:
runtime error: member call on null pointer of type 'struct vec'
/home/vegard/git/gcc/gcc/vec.h:568:54: runtime error: member access within null
pointer of type 'const struct vec'
ASAN:SIGSEGV
=
==16541==ERROR: AddressSanitizer: SEGV on unknown address 0x0004 (pc
0x04edb008 bp 0x7f6282534b40 sp 0x7ffc93cb64d0 T0)
#0 0x4edb007 in vec<tree_node*, va_gc, vl_embed>::is_empty() const
/home/vegard/git/gcc/gcc/vec.h:568
#1 0x4edb007 in add_stmt(tree_node*)
/home/vegard/git/gcc/gcc/cp/semantics.c:390
#2 0x393ff85 in do_pushtag /home/vegard/git/gcc/gcc/cp/name-lookup.c:6485
#3 0x393ff85 in pushtag(tree_node*, tree_node*, tag_scope)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6524
#4 0x2604599 in xref_tag_1 /home/vegard/git/gcc/gcc/cp/decl.c:13761
#5 0x2604599 in xref_tag(tag_types, tree_node*, tag_scope, bool)
/home/vegard/git/gcc/gcc/cp/decl.c:13818
#6 0x3f23b08 in cp_parser_elaborated_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17920
#7 0x3d1beb4 in cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16804
#8 0x3d5bd8c in cp_parser_type_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:21114
#9 0x3e9b6ad in cp_parser_type_id_1
/home/vegard/git/gcc/gcc/cp/parser.c:20957
#10 0x3ee22f0 in cp_parser_type_id
/home/vegard/git/gcc/gcc/cp/parser.c:21025
#11 0x3ee22f0 in cp_parser_postfix_expression
/home/vegard/git/gcc/gcc/cp/parser.c:6728
#12 0x3d6d95e in cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8324
#13 0x3b80029 in cp_parser_cast_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9092
#14 0x3b8cff5 in cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9193
#15 0x3b9a71a in cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9488
#16 0x3bb6708 in cp_parser_constant_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9772
#17 0x3bd90c3 in cp_parser_initializer_clause
/home/vegard/git/gcc/gcc/cp/parser.c:21930
#18 0x3c02785 in cp_parser_initializer
/home/vegard/git/gcc/gcc/cp/parser.c:21870
#19 0x3c0444e in cp_parser_late_parse_one_default_arg
/home/vegard/git/gcc/gcc/cp/parser.c:27785
#20 0x3d2e490 in cp_parser_late_parsing_nsdmi
/home/vegard/git/gcc/gcc/cp/parser.c:27837
#21 0x3d2e490 in cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22739
#22 0x3d2e490 in cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22792
#23 0x3d2e490 in cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16776
#24 0x3f3fdff in cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13631
#25 0x4043abe in cp_parser_single_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:27211
#26 0x4049117 in cp_parser_template_declaration_after_parameters
/home/vegard/git/gcc/gcc/cp/parser.c:26900
#27 0x405c5db in cp_parser_explicit_template_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:27138
#28 0x405c5db in cp_parser_template_declaration_after_export
/home/vegard/git/gcc/gcc/cp/parser.c:27156
#29 0x41bb796 in cp_parser_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12739
#30 0x4188c5f in cp_parser_declaration_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:12658
#31 0x419308b in cp_parser_translation_unit
/home/vegard/git/gcc/gcc/cp/parser.c:4563
#32 0x419308b in c_parse_file() /home/vegard/git/gcc/gcc/cp/parser.c:39019
#33 0x613101d in c_common_parse_file()
/home/vegard/git/gcc/gcc/c-family/c-opts.c:1132
#34 0x10cb4551 in compile_file /home/vegard/git/gcc/gcc/toplev.c:455
#35 0x14c07ed in do_compile /home/vegard/git/gcc/gcc/toplev.c:2132
#36 0x14c07ed in toplev::main(int, char**)
/home/vegard/git/gcc/gcc/toplev.c:2267
#37 0x14eca1c in main /home/vegard/git/gcc/gcc/main.c:39
#38 0x7f628691282f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#39 0x14ef478 in _start
(/home/vegard/personal/programming/gcc/install/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/cc1plus+0x14ef478)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/vegard/git/gcc/gcc/vec.h:568
vec<tree_node*, va_gc, vl_embed>::is_empty() const
==16541==ABORTING

Version:

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

[Bug sanitizer/85029] [8 Regression] -fsanitize=undefined internal compiler error: in maybe_optimize_ubsan_ptr_ifn, at sanopt.c:493

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

--- Comment #2 from Vegard Nossum  ---
I have another test case which crashes in the same way and thus could be fixed
by your patch (I have not tried), but it looks quite different to me:

unsigned register a[] = {a - 1 && 1e9};

[Bug c++/85039] internal compiler error: in nested_anon_class_index, at cp/mangle.c:1626

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

--- Comment #1 from Vegard Nossum  ---
Alternative testcase:

struct d {
} * d::b(__builtin_offsetof(struct {
  struct a {
int c() { return .1f; }
  };
}, ))

[Bug c++/85039] New: nested_anon_class_index

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

Bug ID: 85039
   Summary: nested_anon_class_index
   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:

constexpr int a() {
  __builtin_offsetof(struct {
short b {
  __builtin_offsetof(struct {
struct c {
  void d() {
  }
};
  });
};
  });
}

Output:

$ cc1plus
 constexpr int a() void a()::c::d()
: At global scope:
:6:16: internal compiler error: in nested_anon_class_index, at
cp/mangle.c:1626
0x349df28 nested_anon_class_index
/home/vegard/git/gcc/gcc/cp/mangle.c:1626
0x349df28 write_unnamed_type_name
/home/vegard/git/gcc/gcc/cp/mangle.c:1640
0x349df28 write_unqualified_name
/home/vegard/git/gcc/gcc/cp/mangle.c:1407
0x34caa03 write_prefix
/home/vegard/git/gcc/gcc/cp/mangle.c:1166
0x34ca9fb write_prefix
/home/vegard/git/gcc/gcc/cp/mangle.c:1165
0x34d14eb write_nested_name
/home/vegard/git/gcc/gcc/cp/mangle.c:1083
0x33f4033 write_name
/home/vegard/git/gcc/gcc/cp/mangle.c:976
0x33f7cbc write_local_name
/home/vegard/git/gcc/gcc/cp/mangle.c:2057
0x33f7cbc write_name
/home/vegard/git/gcc/gcc/cp/mangle.c:964
0x33791c5 write_encoding
/home/vegard/git/gcc/gcc/cp/mangle.c:825
0x34e53f8 mangle_decl_string
/home/vegard/git/gcc/gcc/cp/mangle.c:3792
0x34ead33 get_mangled_id
/home/vegard/git/gcc/gcc/cp/mangle.c:3814
0x34ead33 mangle_decl(tree_node*)
/home/vegard/git/gcc/gcc/cp/mangle.c:3852
0x16745350 decl_assembler_name(tree_node*)
/home/vegard/git/gcc/gcc/tree.c:687
0x1716f86d notice_global_symbol(tree_node*)
/home/vegard/git/gcc/gcc/varasm.c:1668
0x7a4933b cgraph_node::finalize_function(tree_node*, bool)
/home/vegard/git/gcc/gcc/cgraphunit.c:452
0x4ffc8c0 expand_or_defer_fn(tree_node*)
/home/vegard/git/gcc/gcc/cp/semantics.c:4287
0x3fc3268 cp_parser_function_definition_after_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26847
0x3fcdaa4 cp_parser_late_parsing_for_member
/home/vegard/git/gcc/gcc/cp/parser.c:27723
0x3d32a56 cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22766
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Built with r258757.

Possibly related: #79850, #85033.

[Bug inline-asm/85034] -O1 internal compiler error: in elimination_costs_in_insn, at reload1.c:3633

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

--- Comment #2 from Vegard Nossum  ---
(In reply to Vegard Nossum from comment #1)
> FWIW, gcc built from r258757 with asan gives:

Nevermind, the asan thing comes from the stack trace and is unrelated (it
appears for all stack traces regardless of the input).

[Bug inline-asm/85034] -O1 internal compiler error: in elimination_costs_in_insn, at reload1.c:3633

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

--- Comment #1 from Vegard Nossum  ---
FWIW, gcc built from r258757 with asan gives:

:4:1: internal compiler error: in elimination_costs_in_insn, at
reload1.c:3633
/home/vegard/git/gcc/libbacktrace/elf.c:2891:22: runtime error: load of
misaligned address 0x7fcd5cfafddd for type 'const uint32_t', which requires 4
byte alignment
0x7fcd5cfafddd: note: pointer points here
 33 2e 73 6f 00 00 00  00 c4 0a 19 a5 00 2e 73  68 73 74 72 74 61 62 00  2e 6e
6f 74 65 2e 67 6e  75
 ^ 
0xfa62b80 elimination_costs_in_insn
/home/vegard/git/gcc/gcc/reload1.c:3630
0xfb2e117 calculate_elim_costs_all_insns()
/home/vegard/git/gcc/gcc/reload1.c:1607
0xcb6411a ira_costs()
/home/vegard/git/gcc/gcc/ira-costs.c:2249
0xca59ed0 ira_build()
/home/vegard/git/gcc/gcc/ira-build.c:3427
0xc8c9fc4 ira
/home/vegard/git/gcc/gcc/ira.c:5295
0xc8c9fc4 execute
/home/vegard/git/gcc/gcc/ira.c:5606

[Bug inline-asm/85034] New: -O1 internal compiler error: in elimination_costs_in_insn, at reload1.c:3633

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

Bug ID: 85034
   Summary: -O1 internal compiler error: in
elimination_costs_in_insn, at reload1.c:3633
   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:

void b() {
  volatile float a;
  asm("" : "=d"(a) : "0Ir"([] {}));
}

Output:

$ cc1plus -O1
 void b() b()::<lambda()> static void b()::<lambda()>::_FUN()
b()::<lambda()>::operator void (*)()() const
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   


Assembling functions:
   void b()during RTL pass: ira

: In function 'void b()':
:4:1: internal compiler error: in elimination_costs_in_insn, at
reload1.c:3633
0x2e67ee7 elimination_costs_in_insn
/home/vegard/git/gcc/gcc/reload1.c:3630
0x2ea41cf calculate_elim_costs_all_insns()
/home/vegard/git/gcc/gcc/reload1.c:1607
0x26cd174 ira_costs()
/home/vegard/git/gcc/gcc/ira-costs.c:2249
0x2687568 ira_build()
/home/vegard/git/gcc/gcc/ira-build.c:3427
0x2640c54 ira
/home/vegard/git/gcc/gcc/ira.c:5295
0x2640c54 execute
/home/vegard/git/gcc/gcc/ira.c:5606
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

Error message looks similar to #50092 and #83926 and a few others, but they are
all supposed to be fixed. Could also be the same as (and fixed by) #84164 but
that's aarch64 and the test case looks quite different (no inline asm). Trunk
on godbolt.org (20180321) also crashes.

[Bug c++/85033] New: internal compiler error: in fold_offsetof_1, at c-family/c-common.c:6269

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

Bug ID: 85033
   Summary: internal compiler error: in fold_offsetof_1, at
c-family/c-common.c:6269
   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 = __builtin_offsetof(struct { enum { a }; }, a)

Output:

$ cc1plus 
:1:53: internal compiler error: in fold_offsetof_1, at
c-family/c-common.c:6269
0x1502073 fold_offsetof_1(tree_node*, tree_code)
/home/vegard/git/gcc/gcc/c-family/c-common.c:6269
0x1504a82 fold_offsetof(tree_node*)
/home/vegard/git/gcc/gcc/c-family/c-common.c:6280
0xf38c24 cp_parser_builtin_offsetof
/home/vegard/git/gcc/gcc/cp/parser.c:9897
0xf38c24 cp_parser_primary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:5396
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
0xecc0a3 cp_parser_constant_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9770
0xed334e cp_parser_initializer_clause
/home/vegard/git/gcc/gcc/cp/parser.c:21916
0xedc293 cp_parser_initializer
/home/vegard/git/gcc/gcc/cp/parser.c:21856
0xfa0f3d cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19677
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
0xff71b3 c_parse_file()
/home/vegard/git/gcc/gcc/cp/parser.c:38995
0x15a3a25 c_common_parse_file()
/home/vegard/git/gcc/gcc/c-family/c-opts.c:1132
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

Seems to go back to 4.1.2.

cc1 prints this instead:

:1:47: warning: declaration does not declare anything
:1:9: error: 'struct ' has no member named 'a'
:1:44: error: expected ',' or ';' at end of input

[Bug c++/85031] New: internal compiler error: Segmentation fault (field_accessor_p()/dfs_locate_field_accessor_pre())

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

Bug ID: 85031
   Summary: internal compiler error: Segmentation fault
(field_accessor_p()/dfs_locate_field_accessor_pre())
   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 {
private:
  int a;
  void b() { return; }
} *a(a->a);

Output:

$ cc1plus 
 void::b()
: At global scope:
:5:9: error: 'int ::a' is private within this context
:3:7: note: declared private here
:5:9: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0x121f448 field_accessor_p
/home/vegard/git/gcc/gcc/cp/search.c:1764
0x121f448 dfs_locate_field_accessor_pre
/home/vegard/git/gcc/gcc/cp/search.c:1819
0x1247ebc dfs_walk_once_accessible_r
/home/vegard/git/gcc/gcc/cp/search.c:1536
0x1247ebc dfs_walk_once_accessible
/home/vegard/git/gcc/gcc/cp/search.c:1603
0x1247ebc locate_field_accessor(tree_node*, tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/search.c:1839
0x1413c73 access_failure_info::maybe_suggest_accessor(bool) const
/home/vegard/git/gcc/gcc/cp/typeck.c:2727
0x1415702 finish_class_member_access_expr(cp_expr, tree_node*, bool, int)
/home/vegard/git/gcc/gcc/cp/typeck.c:2930
0xf4a842 cp_parser_postfix_dot_deref_expression
/home/vegard/git/gcc/gcc/cp/parser.c:7632
0xf75672 cp_parser_postfix_expression
/home/vegard/git/gcc/gcc/cp/parser.c:7276
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
0xed376b cp_parser_parenthesized_expression_list
/home/vegard/git/gcc/gcc/cp/parser.c:7758
0xedc2bc cp_parser_initializer
/home/vegard/git/gcc/gcc/cp/parser.c:21864
0xfa0f3d cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19677
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 <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

7.3.0 seems fine with it.

[Bug inline-asm/85030] New: internal compiler error: Floating point exception (validate_subreg())

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

Bug ID: 85030
   Summary: internal compiler error: Floating point exception
(validate_subreg())
   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
  Target Milestone: ---

Input:

void d() {
  struct f {
int c;
int *b;
int *e;
  } a;

  asm("" : "=rm" (a) : "0" (1));
}

Output:

$ cc1plus 
 void d()
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   

  Assembling functions:
   void d()during RTL pass: reload

: In function 'void d()':
:9:1: internal compiler error: Floating point exception
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0x1d80f52 validate_subreg(machine_mode, machine_mode, rtx_def const*,
poly_int<1u, unsigned long>)
/home/vegard/git/gcc/gcc/emit-rtl.c:910
0x1d81db6 gen_rtx_SUBREG(machine_mode, rtx_def*, poly_int<1u, unsigned long>)
/home/vegard/git/gcc/gcc/emit-rtl.c:1010
0x1d81db6 gen_lowpart_SUBREG(machine_mode, rtx_def*)
/home/vegard/git/gcc/gcc/emit-rtl.c:1026
0x287cde5 match_reload
/home/vegard/git/gcc/gcc/lra-constraints.c:945
0x28ade79 curr_insn_transform
/home/vegard/git/gcc/gcc/lra-constraints.c:4335
0x28b93b6 lra_constraints(bool)
/home/vegard/git/gcc/gcc/lra-constraints.c:4877
0x2829984 lra(_IO_FILE*)
/home/vegard/git/gcc/gcc/lra.c:2419
0x2608794 do_reload
/home/vegard/git/gcc/gcc/ira.c:5465
0x2608794 execute
/home/vegard/git/gcc/gcc/ira.c:5649
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

Looks similar to bug #49522, but that's OLD (and fixed).

It starts failing between 4.7.4 and 4.8.1.

Not C++-specific, cc1 crashes with the same test case.

Clang also seems to segfault on this one...

[Bug sanitizer/85029] New: -fsanitize=undefined internal compiler error: in maybe_optimize_ubsan_ptr_ifn, at sanopt.c:493

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

Bug ID: 85029
   Summary: -fsanitize=undefined internal compiler error: in
maybe_optimize_ubsan_ptr_ifn, at sanopt.c:493
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org,
marxin at gcc dot gnu.org, webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

struct b {
  virtual b c();
  int e;
} register a;

int d(...) {
  return d(a);
}

Output:

$ cc1plus -O1 -fsanitize=undefined
 b::b() b::b() b::b() int d(...) constexpr b::b(const b&) constexpr b::b(const
b&) constexpr b::b(const b&) void
__static_initialization_and_destruction_0(int, int) void _GLOBAL__sub_I_a()
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   


Assembling functions:
   int d(...)during GIMPLE pass: sanopt

: In function 'int d(...)':
:6:5: internal compiler error: in maybe_optimize_ubsan_ptr_ifn, at
sanopt.c:493
0x323c8df maybe_optimize_ubsan_ptr_ifn
/home/vegard/git/gcc/gcc/sanopt.c:493
0x323c8df sanopt_optimize_walker
/home/vegard/git/gcc/gcc/sanopt.c:826
0x323393a sanopt_optimize_walker
/home/vegard/git/gcc/gcc/sanopt.c:873
0x3246393 sanopt_optimize
/home/vegard/git/gcc/gcc/sanopt.c:897
0x3246393 execute
/home/vegard/git/gcc/gcc/sanopt.c:1260
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

7.3.0 says:

: In function 'int d(...)':
:4:12: error: register name not specified for 'a'
 } register a;
^
Compiler returned: 1

clang says (with or without -std=c++14):

:4:3: warning: 'register' storage class specifier is deprecated and
incompatible with C++17 [-Wdeprecated-register]
} register a;
  ^
:4:12: error: illegal storage class on file-scoped variable
} register a;
   ^
1 warning and 1 error generated.
Compiler returned: 1

[Bug inline-asm/85022] internal compiler error: in write_dependence_p, at alias.c:3003

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

Vegard Nossum  changed:

   What|Removed |Added

  Component|c++ |inline-asm

--- Comment #1 from Vegard Nossum  ---
Also fails for C:

struct b extern c;
void a() {
  asm("" : "+m"(c));
}

$ cc1 -O1
 a
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   


Assembling functions:
   aduring RTL pass: cse1

: In function 'a':
:4:1: internal compiler error: in write_dependence_p, at alias.c:3003
0xd58993 write_dependence_p
/home/vegard/git/gcc/gcc/alias.c:3001
0xd59d07 canon_anti_dependence(rtx_def const*, bool, rtx_def const*,
machine_mode, rtx_def*)
/home/vegard/git/gcc/gcc/alias.c:3092

[Bug c++/85022] New: internal compiler error: in write_dependence_p, at alias.c:3003

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

Bug ID: 85022
   Summary: internal compiler error: in write_dependence_p, at
alias.c:3003
   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 b extern c;
void a() {
  asm("" : "+m"(c));
}

Output:

$ cc1plus -O1
 void a()
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   


Assembling functions:
   void a()during RTL pass: cse1

: In function 'void a()':
:4:1: internal compiler error: in write_dependence_p, at alias.c:3003
0x16a44f3 write_dependence_p
/home/vegard/git/gcc/gcc/alias.c:3001
0x16a5867 canon_anti_dependence(rtx_def const*, bool, rtx_def const*,
machine_mode, rtx_def*)
/home/vegard/git/gcc/gcc/alias.c:3092
0x5153789 check_dependence
/home/vegard/git/gcc/gcc/cse.c:1816
0x5153789 invalidate
/home/vegard/git/gcc/gcc/cse.c:1946
0x518e226 cse_insn
/home/vegard/git/gcc/gcc/cse.c:5832
0x519b4b7 cse_extended_basic_block
/home/vegard/git/gcc/gcc/cse.c:6610
0x519b4b7 cse_main
/home/vegard/git/gcc/gcc/cse.c:6789
0x51a15bf rest_of_handle_cse
/home/vegard/git/gcc/gcc/cse.c:7619
0x51a15bf execute
/home/vegard/git/gcc/gcc/cse.c:7662
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

7.3.0 compiles it to just a "ret" and clang fails with:

:3:17: error: dereference of pointer to incomplete type 'class b'
  asm("" : "+m"(c));
^
:1:7: note: forward declaration of 'b'
class b extern c;
  ^
1 error generated.
Compiler returned: 1

[Bug c++/85016] New: internal compiler error: side-effects element in no-side-effects CONSTRUCTOR

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

Bug ID: 85016
   Summary: internal compiler error: side-effects element in
no-side-effects CONSTRUCTOR
   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:

constexpr volatile b(;) >> ;
__attribute__((d(>> [] {
  struct {
int c <<
  } a[] {
b
  }
}))) <<

Output:

$ cc1plus 
:1:21: error: ISO C++ forbids declaration of 'b' with no type
[-fpermissive]
:1:22: error: expected primary-expression before ';' token
:1:23: error: expected unqualified-id before ')' token
:2:18: error: expected primary-expression before '>>' token
 <lambda()>
:4:9: error: expected ';' at end of member declaration
:4:11: error: expected unqualified-id before '<<' token
:7:3: internal compiler error: side-effects element in no-side-effects
CONSTRUCTOR
0x40096e3 verify_constructor_flags(tree_node*)
/home/vegard/git/gcc/gcc/tree.c:2007
0xa310e4 cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4531
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
0x1423653 massage_init_elt
/home/vegard/git/gcc/gcc/cp/typeck2.c:1254
0x142417f process_init_constructor_array
/home/vegard/git/gcc/gcc/cp/typeck2.c:1320
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<tree_node*, va_gc,
vl_embed>**, 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
0xfcf4c5 cp_parser_lambda_body
/home/vegard/git/gcc/gcc/cp/parser.c:10685
0xfcf4c5 cp_parser_lambda_expression
/home/vegard/git/gcc/gcc/cp/parser.c:10186
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

I tried to massage it into something a little better, but this is all I could
do:

constexpr volatile b(;) >> 0;
__attribute__((d(0 >> [] {
  struct {
int c;
  } a[] {
b,
  };
})));

[Bug c++/85015] New: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in build_int_cst, at tree.c:1360

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

Bug ID: 85015
   Summary: internal compiler error: tree check: expected class
'type', have 'exceptional' (error_mark) in
build_int_cst, at tree.c:1360
   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 b() {
  enum &(());
  struct {
void d() { int a[c]; }
  };
}

Output:

$ cc1plus 
 void b()
:2:13: error: expected primary-expression before ')' token
 void b()d()
:4:23: error: use of local variable with automatic storage from
containing function
:2:10: note: 'int&& c' declared here
:4:23: error: use of local variable with automatic storage from
containing function
:2:10: note: 'int&& c' declared here
:4:23: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in build_int_cst, at tree.c:1360
0x660619 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/vegard/git/gcc/gcc/tree.c:9388
0x40992d5 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/vegard/git/gcc/gcc/tree.h:3255
0x40992d5 build_int_cst(tree_node*, poly_int<1u, long>)
/home/vegard/git/gcc/gcc/tree.c:1360
0x1fd2277 round_up_loc(unsigned int, tree_node*, unsigned int)
/home/vegard/git/gcc/gcc/fold-const.c:14350
0x30f9e26 finalize_type_size
/home/vegard/git/gcc/gcc/stor-layout.c:1908
0x3115667 layout_type(tree_node*)
/home/vegard/git/gcc/gcc/stor-layout.c:2578
0x408c0c7 build_array_type_1
/home/vegard/git/gcc/gcc/tree.c:7869
0x135eebe build_cplus_array_type(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/tree.c:985
0xc024d5 create_array_type_for_decl
/home/vegard/git/gcc/gcc/cp/decl.c:9793
0xc024d5 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/home/vegard/git/gcc/gcc/cp/decl.c:10985
0xc158d8 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
/home/vegard/git/gcc/gcc/cp/decl.c:4998
0xf9f96c cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19600
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
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

7.3.0 seems ok

[Bug c++/85014] New: internal compiler error: in lookup_base, at cp/search.c:185

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

Bug ID: 85014
   Summary: internal compiler error: in lookup_base, at
cp/search.c:185
   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 {
  short a[__builtin_constant_p([] {
struct {
  int b = b;
};
  })];
};

Output:

$ cc1plus 
 ::<lambda()>
:5:5: error: abstract declarator '::<lambda()>::' used as declaration
 static void::<lambda()>::_FUN() ::<lambda()>::operator void (*)()() const
: At global scope:
:4:15: internal compiler error: in lookup_base, at cp/search.c:185
0x12417d3 lookup_base(tree_node*, tree_node*, int, base_kind*, int)
/home/vegard/git/gcc/gcc/cp/search.c:185
0x1319eaf maybe_dummy_object(tree_node*, tree_node**)
/home/vegard/git/gcc/gcc/cp/tree.c:3904
0x12aa4de finish_non_static_data_member(tree_node*, tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/semantics.c:1785
0x12aec62 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
/home/vegard/git/gcc/gcc/cp/semantics.c:3726
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
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xecc0a3 cp_parser_constant_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9770
0xed334e cp_parser_initializer_clause
/home/vegard/git/gcc/gcc/cp/parser.c:21916
0xedc293 cp_parser_initializer
/home/vegard/git/gcc/gcc/cp/parser.c:21856
0xedc4d1 cp_parser_late_parse_one_default_arg
/home/vegard/git/gcc/gcc/cp/parser.c:27761
0xf15be0 cp_parser_late_parsing_nsdmi
/home/vegard/git/gcc/gcc/cp/parser.c:27813
0xf15be0 cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22715
0xf231cb cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22768
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
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

Seems to start failing with "confused by earlier errors, bailing out" between
4.6.4 and 4.7.1 on godbolt.org.

[Bug c++/85013] New: :1:41: internal compiler error: in wide_int_to_tree_1, at tree.c:1567 0x4097e2b wide_int_to_tree_1

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

Bug ID: 85013
   Summary: :1:41: internal compiler error: in
wide_int_to_tree_1, at tree.c:1567 0x4097e2b
wide_int_to_tree_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:

a(decltype((0 > 1e91 && 1e31 && (auto

Output:

$ cc1plus -O2
:1:34: error: expected primary-expression before 'auto'
:1:34: error: expected ')' before 'auto'
:1:41: internal compiler error: in wide_int_to_tree_1, at tree.c:1567
0x4097e2b wide_int_to_tree_1
/home/vegard/git/gcc/gcc/tree.c:1567
0x409921a wide_int_to_tree(tree_node*, poly_int<1u,
generic_wide_int<wide_int_ref_storage<false, true> > > const&)
/home/vegard/git/gcc/gcc/tree.c:1692
0x409921a build_int_cst(tree_node*, poly_int<1u, long>)
/home/vegard/git/gcc/gcc/tree.c:1360
0x1fcb3fe make_range(tree_node*, int*, tree_node**, tree_node**, bool*)
/home/vegard/git/gcc/gcc/fold-const.c:4808
0x60591a fold_range_test
/home/vegard/git/gcc/gcc/fold-const.c:5497
0x60591a fold_truth_andor
/home/vegard/git/gcc/gcc/fold-const.c:8143
0x1f845b7 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
/home/vegard/git/gcc/gcc/fold-const.c:10572
0x1fdd559 fold(tree_node*)
/home/vegard/git/gcc/gcc/fold-const.c:11965
0xaaff0b cp_fold
/home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2290
0xab6e7b cp_fold_maybe_rvalue
/home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2006
0xab6e7b cp_fold_rvalue
/home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2027
0xab6e7b cp_fully_fold(tree_node*)
/home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2051
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
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

Bug #83865 has the same error but it's for Fortran and the call stack is
different.

Without -O2 it gives a different error:

:1:34: internal compiler error: in synthesize_implicit_template_parm,
at cp/parser.c:39031
 a(decltype((0 > 1e91 && 1e31 && (auto

That one has multiple possibly related bugs already: #84642, #84610, #83583,
#82768, #78802, so maybe a fix for one of those will also fix this, I don't
know.

[Bug c++/85008] New: internal compiler error: lang_* check: failed in decl_cloned_function_p, at cp/class.c:4577

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

Bug ID: 85008
   Summary: internal compiler error: lang_* check: failed in
decl_cloned_function_p, at cp/class.c:4577
   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() {
  struct b {
~b();
__attribute__((c(::~)))
  }
}

Output:

$ cc1plus 
 void a()
:4:27: error: expected class-name before ')' token
:4:27: internal compiler error: lang_* check: failed in
decl_cloned_function_p, at cp/class.c:4577
0x5efa30 lang_check_failed(char const*, int, char const*)
/home/vegard/git/gcc/gcc/cp/tree.c:5373
0x9b16c7 decl_cloned_function_p(tree_node const*, bool)
/home/vegard/git/gcc/gcc/cp/class.c:4577
0x13255c2 decl_linkage(tree_node*)
/home/vegard/git/gcc/gcc/cp/tree.c:4966
0xc6316d mark_used(tree_node*, int)
/home/vegard/git/gcc/gcc/cp/decl2.c:5316
0x12aebcb 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:3706
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
0xf290c9 cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8240
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
0xed4304 cp_parser_parenthesized_expression_list
/home/vegard/git/gcc/gcc/cp/parser.c:7764
0xed6ddb cp_parser_gnu_attribute_list
/home/vegard/git/gcc/gcc/cp/parser.c:25056
0xed6ddb cp_parser_gnu_attributes_opt
/home/vegard/git/gcc/gcc/cp/parser.c:24971
0xf886f7 cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13431
0xf8 cp_parser_member_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:23522
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
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

7.3.0 says:

: In function 'void a()':
:4:27: error: expected class-name before ')' token
 __attribute__((c(::~)))
   ^
:4:27: error: taking address of destructor 'a()::b::~b'
:5:3: error: expected unqualified-id before '}' token
   }
   ^
:5:4: error: expected ';' after struct definition
   }
^
;
Compiler returned: 1

[Bug inline-asm/84985] New: internal compiler error: in match_reload, at lra-constraints.c:1068

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

Bug ID: 84985
   Summary: internal compiler error: in match_reload, at
lra-constraints.c:1068
   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
  Target Milestone: ---

Input:

int main() {
  int a;
  asm("" : "=d"(a) : "0"(a), "0ae"());
}

Output:

$ cc1plus 
 int main()
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   

  Assembling functions:
   int main()during RTL pass: reload

: In function 'int main()':
:4:1: internal compiler error: in match_reload, at
lra-constraints.c:1068
0x287e277 match_reload
/home/vegard/git/gcc/gcc/lra-constraints.c:1066
0x28ade79 curr_insn_transform
/home/vegard/git/gcc/gcc/lra-constraints.c:4335
0x28b93b6 lra_constraints(bool)
/home/vegard/git/gcc/gcc/lra-constraints.c:4877
0x2829984 lra(_IO_FILE*)
/home/vegard/git/gcc/gcc/lra.c:2419
0x2608794 do_reload
/home/vegard/git/gcc/gcc/ira.c:5465
0x2608794 execute
/home/vegard/git/gcc/gcc/ira.c:5649
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

7.3.0 seems to handle it and outputs:

main:
  pushq %rbp
  movq %rsp, %rbp
  movl -4(%rbp), %eax
  leaq -4(%rbp), %rcx
  movl %eax, %edx
  movl %edx, %eax
  movl %eax, -4(%rbp)
  movl $0, %eax
  popq %rbp
  ret

Clang says:

:3:36: error: more than one input constraint matches the same output
'0'
  asm("" : "=d"(a) : "0"(a), "0ae"());
   ^
:3:26: note: constraint '0' is already present here
  asm("" : "=d"(a) : "0"(a), "0ae"());
 ^
1 error generated.
Compiler returned: 1

[Bug c++/84984] New: internal compiler error: in build2, at tree.c:4686

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

Bug ID: 84984
   Summary: internal compiler error: in build2, at tree.c:4686
   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;
b(decltype( - __builtin_constant_p(0 ?: throw 0) ?: auto));

Output:

$ cc1plus 
:2:60: error: invalid use of 'void'
:2:33: internal compiler error: in build2, at tree.c:4686
0x4025a2b build2(tree_code, tree_node*, tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/tree.c:4685
0x1f9ab52 build2_loc
/home/vegard/git/gcc/gcc/tree.h:4112
0x1f9ab52 fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
/home/vegard/git/gcc/gcc/fold-const.c:12330
0x1f9ab52 fold_build_pointer_plus_loc(unsigned int, tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/fold-const.c:14542
0x10f1df4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/vegard/git/gcc/gcc/cp/pt.c:17557
0xa5796a fold_non_dependent_expr(tree_node*)
/home/vegard/git/gcc/gcc/cp/constexpr.c:5102
0x105112f build_non_dependent_expr(tree_node*)
/home/vegard/git/gcc/gcc/cp/pt.c:25305
0x13959af build_x_conditional_expr(unsigned int, tree_node*, tree_node*,
tree_node*, int)
/home/vegard/git/gcc/gcc/cp/typeck.c:6559
0xecbaa8 cp_parser_question_colon_clause
/home/vegard/git/gcc/gcc/cp/parser.c:9456
0xec682e cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9492
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
0xf7ae79 cp_parser_decltype_expr
/home/vegard/git/gcc/gcc/cp/parser.c:14037
0xf7ae79 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
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

[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 <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

[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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> 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++/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 <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

[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++/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<wi::extended_tree<192> >::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<tree_node*, va_gc,
vl_embed>**, 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 <https://gcc.gnu.org/bugs/> 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 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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> 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 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 <https://gcc.gnu.org/bugs/> 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 
 <lambda()> <lambda()>::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<tree_node*, va_gc,
vl_embed>**, 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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

[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 <https://gcc.gnu.org/bugs/> for instructions.

Version:

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

[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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> 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 <https://gcc.gnu.org/bugs/> for instructions.

Version:

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