[Bug bootstrap/92002] [10 regression] -Wuninitialized warning in gcc/wide-int.cc

2019-10-06 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92002

Rainer Orth  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #1 from Rainer Orth  ---
A reghunt identified this patch as the culprit:

* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT,
MAX_INLINE_INSNS_AUTO_O2_LIMIT): New.
* ipa-inline.c (inline_insns_single, inline_insns_auto): New functions.
(can_inline_edge_by_limits_p): Use it.
(big_speedup_p): Use PARAM_INLINE_MIN_SPEEDUP_O2.
(want_inline_small_function_p): Use O2 bounds.
(edge_badness): LIkewise.
* opts.c (default_options): Add OPT_finline_functions.
* params.def (PARAM_INLINE_MIN_SPEEDUP_O2,
PARAM_MAX_INLINE_INSNS_SINGLE_O2, PARAM_MAX_INLINE_INSNS_AUTO_O2):
New parameters.

[Bug bootstrap/92002] [10 regression] -Wuninitialized warning in gcc/wide-int.cc

2019-10-06 Thread hubicka at ucw dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92002

--- Comment #2 from Jan Hubicka  ---
It is patch enabling auto-inlining at -O2, so we have another false
positive I guess. I fixed couple of them which reproduced during x86-64
bootstrap for me.

[Bug c++/92005] New: switch code generation regression

2019-10-06 Thread pdimov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92005

Bug ID: 92005
   Summary: switch code generation regression
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pdimov at gmail dot com
  Target Milestone: ---

The following code:

```
template struct overloaded : Ts... { using Ts::operator()...; };
template overloaded(Ts...) -> overloaded;

struct T0 {};
struct T1 {};
struct T2 {};
struct T3 {};
struct T4 {};

struct variant
{
unsigned index_;

union
{
T0 t0_;
T1 t1_;
T2 t2_;
T3 t3_;
T4 t4_;
};
};

template int visit( F f, variant const& v )
{
switch( v.index_ )
{
case 0: return f( v.t0_ );
case 1: return f( v.t1_ );
case 2: return f( v.t2_ );
case 3: return f( v.t3_ );
case 4: return f( v.t4_ );
default: __builtin_unreachable();
}
}

int do_visit(variant const& v) {
 return visit(overloaded{
[](T0 val) { return 3; },
[](T1 val) { return 5; },
[](T2 val) { return 8; },
[](T3 val) { return 9; },
[](T4 val) { return 10; }
}, v);
}
```

(https://godbolt.org/z/uxQ6KF)

generates

```
do_visit(variant const&):
mov eax, DWORD PTR [rdi]
jmp [QWORD PTR .L4[0+rax*8]]
.L4:
.quad   .L8
.quad   .L7
.quad   .L9
.quad   .L5
.quad   .L3
.L9:
mov eax, 8
ret
.L7:
mov eax, 5
ret
.L8:
mov eax, 3
ret
.L5:
mov eax, 9
ret
.L3:
mov eax, 10
ret
```

with the current gcc trunk on godbolt.org (g++ (Compiler-Explorer-Build) 10.0.0
20191005 (experimental)) and

```
do_visit(variant const&):
mov eax, DWORD PTR [rdi]
mov eax, DWORD PTR CSWTCH.7[0+rax*4]
ret
CSWTCH.7:
.long   3
.long   5
.long   8
.long   9
.long   10
```

with gcc 9.2.

[Bug target/91474] Internal compiler error when building mabi=32 mips64-elf cross-compiler: segfault in parallel_settings.cc

2019-10-06 Thread joey.dumont at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91474

--- Comment #11 from Joey Dumont  ---
I can confirm that this revision fixes the issue. I'll try to lookout for the
gcc-9 version where this will be released. Thank you!

[Bug fortran/92006] New: storage_size() returns incorrect value on unlimited polymorphic variable (CLASS(*)) when passed a CHARACTER variable

2019-10-06 Thread urbanjost at comcast dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92006

Bug ID: 92006
   Summary: storage_size() returns incorrect value on unlimited
polymorphic variable (CLASS(*))  when passed a
CHARACTER variable
   Product: gcc
   Version: 7.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: urbanjost at comcast dot net
  Target Milestone: ---

[Bug fortran/92006] storage_size() returns incorrect value on unlimited polymorphic variable (CLASS(*)) when passed a CHARACTER variable

2019-10-06 Thread urbanjost at comcast dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92006

--- Comment #1 from urbanjost at comcast dot net ---
I expect the following call to storage_size() to return the value 80 whether
called from within a select or not. I did not see the same issue with any other
type, including a type such as

   type string
  character(len=10) :: chars
   enddtype string

program testit
   use iso_c_binding
   implicit none
   character(len=10) :: string='abcdefghij'
   call psize(string)
contains
   subroutine psize(chars)
  class(*) :: chars
  select type(chars)
   type is(character(len=*))
 write(*,*)'in select ',chars,storage_size(chars)
  end select
  write(*,*)'not in select',storage_size(chars)
   end subroutine psize
end program testit

Results:

$ ./a.exe
 in select abcdefghij  80
 not in select   8

[Bug fortran/92006] storage_size() returns incorrect value on unlimited polymorphic variable (CLASS(*)) when passed a CHARACTER variable

2019-10-06 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92006

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||kargl at gcc dot gnu.org
 Depends on||84006
   Target Milestone|--- |10.0

--- Comment #2 from kargl at gcc dot gnu.org ---
Depends on, if not a duplicate, of 84006


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84006
[Bug 84006] [7/8/9/10 Regression] ICE in storage_size() with CLASS entity

[Bug rtl-optimization/92007] New: [9/10 Regression] ICE: verify_flow_info failed (error: EH edge crosses section boundary in bb 7)

2019-10-06 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92007

Bug ID: 92007
   Summary: [9/10 Regression] ICE: verify_flow_info failed (error:
EH edge crosses section boundary in bb 7)
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: EH, ice-checking, ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-10.0.0-alpha20190929 snapshot (r276272) ICEs when compiling the following
testcase w/ -O2 -fno-tree-dominator-opts -fno-tree-forwprop --param
max-cse-insns=0:

void
sb (int *);

class d4 {
public:
  ~d4();
  void gb ();
  int op () { return no; }
  int wl () { return tf; }
  bool ee () try { gb (); } catch (...) { return false; }
  bool b1 () { return (tf == no) ? false : ee (); }

private:
  int no, tf;
};

void
hs (int *v9)
{
  d4 p6;

  p6.gb ();
  if (p6.op () > p6.wl ())
{
  p6.b1 ();
  sb (v9);
}
}

% g++-10.0.0-alpha20190929 -O2 -fno-tree-dominator-opts -fno-tree-forwprop
--param max-cse-insns=0 -w -c u10jac3e.cc
u10jac3e.cc: In function 'void hs(int*)':
u10jac3e.cc:28:1: error: EH edge crosses section boundary in bb 7
   28 | }
  | ^
during RTL pass: postreload_jump
u10jac3e.cc:28:1: internal compiler error: verify_flow_info failed
0xb5785a verify_flow_info()
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190929/work/gcc-10-20190929/gcc/cfghooks.c:269
0x17969c6 checking_verify_flow_info
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190929/work/gcc-10-20190929/gcc/cfghooks.h:212
0x17969c6 try_optimize_cfg
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190929/work/gcc-10-20190929/gcc/cfgcleanup.c:3010
0x17969c6 cleanup_cfg(int)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190929/work/gcc-10-20190929/gcc/cfgcleanup.c:3175
0x1797843 execute
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190929/work/gcc-10-20190929/gcc/cfgcleanup.c:3315

[Bug target/92008] Build failure on cygwin

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

--- Comment #1 from Thomas Koenig  ---
Created attachment 47000
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47000&action=edit
config.status

[Bug target/92008] New: Build failure on cygwin

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

Bug ID: 92008
   Summary: Build failure on cygwin
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

Created attachment 46999
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46999&action=edit
config.log

With current cygwin and current trunk, I get

gcc -c  -g -DHAVE_CONFIG_H  -I. -I/home/ig25/trunk/intl plural.c
In file included from /home/ig25/trunk/intl/plural.y:35:0:
/home/ig25/trunk/intl/plural-exp.h:102:23: error: conflicting types for
'libintl_gettextparse'
 # define PLURAL_PARSE libintl_gettextparse
   ^
/home/ig25/trunk/intl/plural.y:40:25: note: in expansion of macro
'PLURAL_PARSE'
 # define __gettextparse PLURAL_PARSE
 ^~~~
plural.c:184:5: note: in expansion of macro '__gettextparse'
 int __gettextparse (void);
 ^~
/home/ig25/trunk/intl/plural-exp.h:102:23: note: previous declaration of
'libintl_gettextparse' was here
 # define PLURAL_PARSE libintl_gettextparse
   ^
/home/ig25/trunk/intl/plural-exp.h:114:12: note: in expansion of macro
'PLURAL_PARSE'
 extern int PLURAL_PARSE PARAMS ((void *arg));
^~~~
/home/ig25/trunk/intl/plural-exp.h:102:23: error: conflicting types for
'libintl_gettextparse'
 # define PLURAL_PARSE libintl_gettextparse
   ^
/home/ig25/trunk/intl/plural.y:40:25: note: in expansion of macro
'PLURAL_PARSE'
 # define __gettextparse PLURAL_PARSE
 ^~~~
plural.c:63:25: note: in expansion of macro '__gettextparse'
 #define yyparse __gettextparse
 ^~
plural.c:1129:1: note: in expansion of macro 'yyparse'
 yyparse (void)
 ^~~
/home/ig25/trunk/intl/plural-exp.h:102:23: note: previous declaration of
'libintl_gettextparse' was here
 # define PLURAL_PARSE libintl_gettextparse
   ^
/home/ig25/trunk/intl/plural-exp.h:114:12: note: in expansion of macro
'PLURAL_PARSE'
 extern int PLURAL_PARSE PARAMS ((void *arg));
^~~~
plural.c: In function 'libintl_gettextparse':
plural.c:64:25: error: too few arguments to function '__gettextlex'
 #define yylex   __gettextlex
 ^
plural.c:1298:16: note: in expansion of macro 'yylex'
   yychar = yylex (&yylval);
^
plural.c:64:25: note: declared here
 #define yylex   __gettextlex
 ^
/home/ig25/trunk/intl/plural.y:69:12: note: in expansion of macro 'yylex'
 static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
^
/home/ig25/trunk/intl/plural.y:178:29: error: 'arg' undeclared (first use in
this function)
  ((struct parse_args *) arg)->res = $1;
 ^~~
/home/ig25/trunk/intl/plural.y:178:29: note: each undeclared identifier is
reported only once for each function it appears in
make[3]: *** [Makefile:133: plural.o] Error 1
make[3]: Leaving directory '/cygdrive/e/trunk-bin/intl'

[Bug target/92008] Build failure on cygwin

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

--- Comment #2 from Thomas Koenig  ---
Created attachment 47001
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47001&action=edit
plural.i from adding -save-temps by hand to the Makefile in intl

[Bug target/92008] Build failure on cygwin

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

--- Comment #3 from Thomas Koenig  ---
If there's anything else needed, let me know.
In the meantime, back to booting Linux :-)

[Bug c++/92005] [10 Regression] switch code generation regression

2019-10-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92005

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-10-06
 CC||hubicka at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
   Target Milestone|--- |10.0
Summary|switch code generation  |[10 Regression] switch code
   |regression  |generation regression
 Ever confirmed|0   |1

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

[Bug c++/92005] [10 Regression] switch code generation regression

2019-10-06 Thread pdimov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92005

--- Comment #2 from Peter Dimov  ---
r276416 makes -O2 inline less, and -O3 does fix this specific case. However,
there appears to be some deeper issue here. I've reduced the number of cases
from 10 to 5 for the example, but when I increase them back to 10 as in
https://godbolt.org/z/VyCeWQ, gcc 9.2 still generates a simple lookup table at
-O2, whereas gcc 10 generates a jump table even at -O3:
https://godbolt.org/z/qJqNDh.

```
template struct overloaded : Ts... { using Ts::operator()...; };
template overloaded(Ts...) -> overloaded;

struct T0 {};
struct T1 {};
struct T2 {};
struct T3 {};
struct T4 {};
struct T5 {};
struct T6 {};
struct T7 {};
struct T8 {};
struct T9 {};

struct variant
{
unsigned index_;

union
{
T0 t0_;
T1 t1_;
T2 t2_;
T3 t3_;
T4 t4_;
T5 t5_;
T6 t6_;
T7 t7_;
T8 t8_;
T9 t9_;
};
};

template int visit( F f, variant const& v )
{
switch( v.index_ )
{
case 0: return f( v.t0_ );
case 1: return f( v.t1_ );
case 2: return f( v.t2_ );
case 3: return f( v.t3_ );
case 4: return f( v.t4_ );
case 5: return f( v.t5_ );
case 6: return f( v.t6_ );
case 7: return f( v.t7_ );
case 8: return f( v.t8_ );
case 9: return f( v.t9_ );
default: __builtin_unreachable();
}
}

int do_visit(variant const& v) {
 return visit(overloaded{
[](T0 val) { return 3; },
[](T1 val) { return 5; },
[](T2 val) { return 8; },
[](T3 val) { return 9; },
[](T4 val) { return 10; },
[](T5 val) { return 11; },
[](T6 val) { return 12; },
[](T7 val) { return 13; },
[](T8 val) { return 14; },
[](T9 val) { return 233; }
}, v);
}

```

[Bug c++/92009] New: [10 Regression] ICE: Segmentation fault (in is_really_empty_class)

2019-10-06 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92009

Bug ID: 92009
   Summary: [10 Regression] ICE: Segmentation fault (in
is_really_empty_class)
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-10.0.0-alpha20191006 snapshot (r276640) ICEs when compiling the following
testcase reduced from test/CodeGenCXX/rtti-layout.cpp from the clang 9.0.0 test
suite:

namespace std {
  class type_info {};
}

bool
a2 ()
{
  return ((void **) &typeid (int))[0];
}

% g++-10.0.0-alpha20191006 -c i5vvdig1.cpp
i5vvdig1.cpp: In function 'bool a2()':
i5vvdig1.cpp:8:37: internal compiler error: Segmentation fault
8 |   return ((void **) &typeid (int))[0];
  | ^
0xe6abc6 crash_signal
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/toplev.c:326
0x80a407 tree_check(tree_node*, char const*, int, char const*, tree_code)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/tree.h:3266
0x80a407 is_really_empty_class(tree_node*, bool)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/class.c:8450
0x8214d3 cxx_eval_constant_expression
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:4759
0x82a6be cxx_eval_component_reference
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:2846
0x822c5f cxx_eval_constant_expression
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:5178
0x82a6be cxx_eval_component_reference
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:2846
0x822c5f cxx_eval_constant_expression
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:5178
0x829b53 cxx_eval_indirect_ref
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:3672
0x821194 cxx_eval_constant_expression
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:5003
0x824e57 cxx_eval_outermost_constant_expr
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:5713
0x828dde maybe_constant_value(tree_node*, tree_node*, bool)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/constexpr.c:5964
0x839efe cp_fully_fold(tree_node*)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/cp-gimplify.c:2215
0x9a5951 cp_build_binary_op(op_location_t const&, tree_code, tree_node*,
tree_node*, int)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/typeck.c:5597
0x9a8e4e build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, bool)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/typeck.c:4316
0x9a8e4e cp_truthvalue_conversion(tree_node*)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/typeck.c:5926
0x83fd98 cp_convert(tree_node*, tree_node*, int)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/cvt.c:636
0x83fd98 cp_convert_and_check(tree_node*, tree_node*, int)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/cvt.c:655
0x7f0e08 convert_like_real
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/call.c:7520
0x7f2335 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
   
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191006/work/gcc-10-20191006/gcc/cp/call.c:11259