[Bug target/91130] [9/10 Regression] -MF clashes with -flto on aarch64

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91130

--- Comment #31 from Martin Liška  ---
(In reply to Richard Earnshaw from comment #30)
> Makes sense.  I'm going to wait now until Joseph gets back and has had a
> chance to comment.

@Joseph: May I please remind you this?

[Bug lto/91222] [10 Regression] 507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt.c:1006 since r273571

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91222

--- Comment #2 from Jan Hubicka  ---
This patch fixes the ICE
Index: ipa-devirt.c
===
--- ipa-devirt.c(revision 273865)
+++ ipa-devirt.c(working copy)
@@ -1003,7 +1003,7 @@ warn_types_mismatch (tree t1, tree t2, l
n2 = DECL_NAME (n2);
   /* Most of the time, the type names will match, do not be unnecesarily
  verbose.  */
-  if (IDENTIFIER_POINTER (n1) != IDENTIFIER_POINTER (n2))
+  if (n1 != n2)
 inform (loc_t1,
"type %qT defined in anonymous namespace cannot match "
"type %qT across the translation unit boundary",
however the warnings output are:
2.ii:62:3: warning: ‘ml_bssnrest_’ violates the C++ One Definition Rule [-Wodr]
   62 | } ml_bssnrest_;
  |   ^
1.ii:2:8: note: type ‘struct ’ defined in anonymous namespace cannot
match across the translation unit boundary
2 | struct {
  |^
2.ii:2:15: note: the incompatible type defined in another translation unit
2 | extern struct {
  |   ^
1.ii:62:3: note: ‘ml_bssnrest_’ was previously declared here
   62 | } ml_bssnrest_;
  |   ^

Now I wonder why C++ FE makes the struct anonymous namespace when it is
declared with extern "C".
I have checked that type_in_anonymous_namespace_p(prevailing_type) returns true
because mangled name is  which comes from C++ FE.

I will check in the patch to avoid ICE. Jason, can you please look if it is
correct to consider these types anonymous?

[Bug lto/91222] [10 Regression] 507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt.c:1006 since r273571

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91222

--- Comment #3 from Jan Hubicka  ---
Author: hubicka
Date: Mon Jul 29 08:18:38 2019
New Revision: 273866

URL: https://gcc.gnu.org/viewcvs?rev=273866&root=gcc&view=rev
Log:

PR lto/91222
* ipa-devirt.c (warn_types_mismatch): Compare indentifiers
than INDENTIFIER_POINTER.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-devirt.c

[Bug c++/91222] [10 Regression] 507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt.c:1006 since r273571

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91222

Jan Hubicka  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
 CC||jason at redhat dot com
  Component|lto |c++
   Assignee|hubicka at gcc dot gnu.org |unassigned at gcc dot 
gnu.org

--- Comment #4 from Jan Hubicka  ---


I am changing component to C++. It seems to me that types in question should
not be considered anonymous namespace.

[Bug tree-optimization/91227] pointer relational expression not folded but equivalent inequality is

2019-07-29 Thread fw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91227

--- Comment #13 from Florian Weimer  ---
(In reply to Marc Glisse from comment #12)
> (In reply to Florian Weimer from comment #11)
> > GCC on ELF provides defined address ordering for separate objects via linker
> > ordering and section attributes.  I think part of these extensions is that
> > it is possible to check at run time whether an object falls into a specific
> > section, and where.  Support for this must be preserved in some fashion.
> 
> How about casting to uintptr_t before comparing? It isn't really formalized,
> but I think that's the extension gcc provides to safely do such comparisons.

I don't see why I cast should magically fix this issue, when it it does not
help with broadly similar matters related to aliasing.

A documented GCC extensions would help, of course.

[Bug middle-end/91267] [10 regression] SEGV in value_range_base::equal_p

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91267

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #9 from Richard Biener  ---
Mine.

[Bug middle-end/91267] [10 regression] SEGV in value_range_base::equal_p

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91267

--- Comment #10 from Richard Biener  ---
Testing returning false which is basically what we did before (just quicker).

This may be an argument for making the lattice expandable.

[Bug tree-optimization/91227] pointer relational expression not folded but equivalent inequality is

2019-07-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91227

--- Comment #14 from Marc Glisse  ---
(In reply to Florian Weimer from comment #13)
> I don't see why I cast should magically fix this issue,

In libstdc++, std::less does such a cast, there were discussions about it
at that time.

[Bug libstdc++/91281] std::optional debug checks

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91281

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-07-29
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
Agreed. It should probably be checked with __glibcxx_assert so it's enabled by
_GLIBCXX_ASSERTIONS not just the full Debug Mode.

[Bug c++/51333] cxxabi.h incompatible with -fkeep-inline-functions at link time

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51333

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-07-29
 Ever confirmed|0   |1

[Bug debug/86638] Og guality failures without -ftree-sra

2019-07-29 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86638

--- Comment #4 from rsandifo at gcc dot gnu.org  
---
Author: rsandifo
Date: Mon Jul 29 08:52:56 2019
New Revision: 273872

URL: https://gcc.gnu.org/viewcvs?rev=273872&root=gcc&view=rev
Log:
Prevent tree-ssa-dce.c from deleting stores at -Og

DCE tries to delete dead stores to local data and also tries to insert
debug binds for simple cases:

  /* If this is a store into a variable that is being optimized away,
 add a debug bind stmt if possible.  */
  if (MAY_HAVE_DEBUG_BIND_STMTS
  && gimple_assign_single_p (stmt)
  && is_gimple_val (gimple_assign_rhs1 (stmt)))
{
  tree lhs = gimple_assign_lhs (stmt);
  if ((VAR_P (lhs) || TREE_CODE (lhs) == PARM_DECL)
  && !DECL_IGNORED_P (lhs)
  && is_gimple_reg_type (TREE_TYPE (lhs))
  && !is_global_var (lhs)
  && !DECL_HAS_VALUE_EXPR_P (lhs))
{
  tree rhs = gimple_assign_rhs1 (stmt);
  gdebug *note
= gimple_build_debug_bind (lhs, unshare_expr (rhs), stmt);
  gsi_insert_after (i, note, GSI_SAME_STMT);
}
}

But this doesn't help for things like "print *ptr" when ptr points
to the local variable (tests Og-dce-1.c and Og-dce-2.c).  It can
also introduce wrong debug info for earlier references (second test
in Og-dce-3.c) or make earlier references unavailable (first test
in Og-dce-3.c).

So for -Og I think it'd be better not to delete any stmts with
vdefs for now.  This also means that we can avoid the potentially
expensive vop walks (which already have a cut-off, but still).

The patch also fixes the Og failures in gcc.dg/guality/pr54970.c
(PR 86638).

2019-07-29  Richard Sandiford  

gcc/
PR debug/86638
* tree-ssa-dce.c (keep_all_vdefs_p): New function.
(mark_stmt_if_obviously_necessary): Mark all stmts with vdefs as
necessary if keep_all_vdefs_p is true.
(mark_aliased_reaching_defs_necessary): Add a gcc_checking_assert
that keep_all_vdefs_p is false.
(mark_all_reaching_defs_necessary): Likewise.
(propagate_necessity): Skip the vuse scan if keep_all_vdefs_p is true.

gcc/testsuite/
* c-c++-common/guality/Og-dce-1.c: New test.
* c-c++-common/guality/Og-dce-2.c: Likewise.
* c-c++-common/guality/Og-dce-3.c: Likewise.

Added:
trunk/gcc/testsuite/c-c++-common/guality/Og-dce-1.c
trunk/gcc/testsuite/c-c++-common/guality/Og-dce-2.c
trunk/gcc/testsuite/c-c++-common/guality/Og-dce-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-dce.c

[Bug libstdc++/51333] cxxabi.h incompatible with -fkeep-inline-functions at link time

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51333

Jonathan Wakely  changed:

   What|Removed |Added

  Component|c++ |libstdc++

--- Comment #5 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #1)
> works with -lsupc++ but I'm not sure why it fails without

Because the missing symbol is only defined in libsupc++.a and libstdc++.a but
not in libstdc++.so

[Bug tree-optimization/91280] [8/9/10 Regression] ICE in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259 since r260354

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91280

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #1 from Richard Biener  ---
Hmm, this has earlier errors:

t.ii:123:20: error: invalid use of incomplete type ‘class
TensorMap, 0>’
  123 |   static const int NumInputDims = H::value;
  |^~~~

so - too much testcase reduction?

But yeah, I can see what goes wrong - get_constraint_for_component_ref
doesn't expect get_constraint_for_1 on the base, here MEM[&decl + 16],
to return multiple constraints but when decl has subvars then if
&decl + 16 is not exactly at a subvar we'll include the next as well.

[Bug libstdc++/51333] cxxabi.h incompatible with -fkeep-inline-functions at link time

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51333

--- Comment #6 from Jonathan Wakely  ---
The testcase linked OK with 4.4 but not 4.5, so I suspect it started to fail
after r154054 which moved the recursive_init_error definition into the cxxabi.h
header.

The symbol was already missing from libstdc++.so in 4.4, but didn't cause a
linker error because it wasn't declared in the header.

[Bug testsuite/91258] [10 regression] g++.dg/ubsan/vla-1.C and gcc.dg/strlenopt-70.c fail starting with r273783

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91258

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

[Bug tree-optimization/91265] [10 Regression] new breakage for g++.dg/cpp0x/pr82560.C

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91265

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1
 CC||marxin at gcc dot gnu.org
  Component|c++ |tree-optimization
Version|unknown |10.0
Summary|new breakage for|[10 Regression] new
   |g++.dg/cpp0x/pr82560.C  |breakage for
   ||g++.dg/cpp0x/pr82560.C

--- Comment #3 from Richard Biener  ---
Was already noted as followup on the patch I think.

[Bug libstdc++/51333] cxxabi.h incompatible with -fkeep-inline-functions at link time

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51333

--- Comment #7 from Jonathan Wakely  ---
We don't export the recursive_init_error symbols from the shared library. That
might be intentional, and wasn't a problem when they weren't declared in a
public header.

[Bug ada/91268] [10 Regression] adaint.c:38: warning: "_REENTRANT" redefined

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91268

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
   Target Milestone|--- |10.0

[Bug c++/91270] [10 Regression] ICE in verify_use at gcc/tree-ssa.c:883 since r273791

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91270

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

[Bug libstdc++/91259] Parenthesize requires clauses that contain expressions that are not just a value of type bool

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91259

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #4 from Jonathan Wakely  ---
Fixed in r273833.

[Bug libstdc++/91259] Parenthesize requires clauses that contain expressions that are not just a value of type bool

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91259

--- Comment #5 from Jonathan Wakely  ---
(In reply to David Stone from comment #0)
> libstdc++ contains many expressions that are not parenthesized

Many?

> that do not meet these requirements (this was not true of the Concepts TS,
> but as changed as part of standardization). For instance, in , we
> have `requires ! _Std_pair<_Tp>`.

I'm pretty sure that's the only use of concepts in the whole library.

[Bug middle-end/91267] [10 regression] SEGV in value_range_base::equal_p

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91267

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Mon Jul 29 10:10:15 2019
New Revision: 273874

URL: https://gcc.gnu.org/viewcvs?rev=273874&root=gcc&view=rev
Log:
2019-07-29  Richard Biener  

PR tree-optimization/91267
* vr-values.c (vr_values::update_value_range): Add early return
for effectively VARYING lattice entry.

* gcc.dg/torture/pr91267.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr91267.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/vr-values.c

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #1 from Jan Hubicka  ---
This seems to work for me with current trunk

hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/1.ii
extern "C" {
struct {
} ltregul_;
}
hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/2.F
common /ltregul/ zeroeps
end 
hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./gfortran -B ./ ~/1.ii
~/2.F -flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./xg++ -B ./ ~/1.ii ~/2.F
-flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
/usr/local/x86_64-pc-linux-gnu/bin/ld: /tmp/cck5WNC7.ltrans0.ltrans.o: in
function `main':
:(.text.startup+0x5): undefined reference to `_gfortran_set_args'
/usr/local/x86_64-pc-linux-gnu/bin/ld: :(.text.startup+0x14):
undefined reference to `_gfortran_set_options'
collect2: error: ld returned 1 exit status

[Bug other/91284] New: Gcc for aarch64 binaries

2019-07-29 Thread abinaya.manikandan at wipro dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91284

Bug ID: 91284
   Summary: Gcc for aarch64 binaries
   Product: gcc
   Version: 8.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: abinaya.manikandan at wipro dot com
  Target Milestone: ---

Hi,

We have been using Redhat6/7 hosts with x86_84 architecture.

Our user has requested us to create gcc - 8.3.0 [RPM] with aarch64
architecture.

Do we have any option to cross compiling gcc - 8.3.0 with both x86_64 and
aarch64.

Please help us here.

Regards,
Abinaya

[Bug tree-optimization/91265] [10 Regression] new breakage for g++.dg/cpp0x/pr82560.C

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91265

--- Comment #4 from Martin Liška  ---
Fixed with r273875:

2019-07-29  Martin Liska  

* tree-ssa-dce.c (eliminate_unnecessary_stmts): Do not
remove LHS of operator new call.  It's handled latter.

[Bug tree-optimization/91265] [10 Regression] new breakage for g++.dg/cpp0x/pr82560.C

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91265

Martin Liška  changed:

   What|Removed |Added

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

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

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #2 from Martin Liška  ---
(In reply to Jan Hubicka from comment #1)
> This seems to work for me with current trunk

No, it's broken also on current trunk.

> 
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/1.ii
> extern "C" {
> struct {
> } ltregul_;
> }
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ cat ~/2.F
> common /ltregul/ zeroeps
> end 
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./gfortran -B ./ ~/1.ii
> ~/2.F -flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
> hubicka@lomikamen-jh:/aux/hubicka/trunk4/build2/gcc$ ./xg++ -B ./ ~/1.ii
> ~/2.F -flto -O2 -B ../x86_64-pc-linux-gnu/libgfortran/
> /usr/local/x86_64-pc-linux-gnu/bin/ld: /tmp/cck5WNC7.ltrans0.ltrans.o: in
> function `main':
> :(.text.startup+0x5): undefined reference to `_gfortran_set_args'
> /usr/local/x86_64-pc-linux-gnu/bin/ld: :(.text.startup+0x14):
> undefined reference to `_gfortran_set_options'
> collect2: error: ld returned 1 exit status

Please run it from a location where you have properly installed compiler:

$ gcc -v
gcc --version
gcc (GCC) 10.0.0 20190723 (experimental

$ g++ 1.ii 2.F -flto -O2 
2.F:1:3: warning: type of ‘ltregul’ does not match original declaration
[-Wlto-type-mismatch]
1 |  common /ltregul/ zeroeps
  |   ^
lto1: internal compiler error: in warn_types_mismatch, at ipa-devirt.c:995
0xcab6f2 warn_types_mismatch(tree_node*, tree_node*, unsigned int, unsigned
int)
/home/marxin/Programming/gcc/gcc/ipa-devirt.c:995
0x89f8d7 lto_symtab_merge_decls_2
/home/marxin/Programming/gcc/gcc/lto/lto-symtab.c:722
0x89ffe9 lto_symtab_merge_decls_1
/home/marxin/Programming/gcc/gcc/lto/lto-symtab.c:861
0x8a00e3 lto_symtab_merge_decls()
/home/marxin/Programming/gcc/gcc/lto/lto-symtab.c:887
0x8b4854 read_cgraph_and_symbols(unsigned int, char const**)
/home/marxin/Programming/gcc/gcc/lto/lto-common.c:2839
0x885bb5 lto_main()
/home/marxin/Programming/gcc/gcc/lto/lto.c:616

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #3 from Jan Hubicka  ---
Still works for me
hubicka@lomikamen-jh:~$ /aux/hubicka/trunk-install/bin/g++ 1.ii 2.F -O2 -flto
/usr/local/bin/ld: /tmp/ccpfzvWm.ltrans0.ltrans.o: in function `main':
:(.text.startup+0x5): undefined reference to `_gfortran_set_args'
/usr/local/bin/ld: :(.text.startup+0x14): undefined reference to
`_gfortran_set_options'
collect2: error: ld returned 1 exit status

also with system compiler on tumbleweed
There is extra cat in 1.ii, perhaps it is truncated?

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #4 from Martin Liška  ---
Created attachment 46633
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46633&action=edit
1.ii

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #5 from Martin Liška  ---
Created attachment 46634
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46634&action=edit
2.F

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #6 from Martin Liška  ---
(In reply to Jan Hubicka from comment #3)
> Still works for me
> hubicka@lomikamen-jh:~$ /aux/hubicka/trunk-install/bin/g++ 1.ii 2.F -O2 -flto
> /usr/local/bin/ld: /tmp/ccpfzvWm.ltrans0.ltrans.o: in function `main':
> :(.text.startup+0x5): undefined reference to `_gfortran_set_args'
> /usr/local/bin/ld: :(.text.startup+0x14): undefined reference to
> `_gfortran_set_options'
> collect2: error: ld returned 1 exit status
> 
> also with system compiler on tumbleweed
> There is extra cat in 1.ii, perhaps it is truncated?

I've just uploaded test-cases, please test it. Using TW GCC:

$ g++ --version
g++ (SUSE Linux) 9.1.1 20190723 [gcc-9-branch revision 273734]

$ g++ 1.ii 2.F -flto -O2 
2.F:1:3: warning: type of ‘ltregul’ does not match original declaration
[-Wlto-type-mismatch]
1 |  common /ltregul/ zeroeps
  |   ^
lto1: internal compiler error: in warn_types_mismatch, at ipa-devirt.c:1133
0x7fc5fcd15bca __libc_start_main
../csu/libc-start.c:308

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

--- Comment #7 from Jan Hubicka  ---
aha, relies on indentation of common in 2.F.  i will check what goes wrong.

[Bug tree-optimization/91257] [7/8/9/10 Regression] Compile-time and memory-hog hog

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91257

Richard Biener  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #3 from Richard Biener  ---
There's nothing IPA in it so the testcase can be cut to contain only a single
function.  I have a patch to improve VRP time a bit.  The PTA slowness will
be quite difficult to deal with.  FRE is somewhat high up because we have
very many SSA names and tracking availability has some constant overhead.

[Bug tree-optimization/91257] [7/8/9/10 Regression] Compile-time and memory-hog hog

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91257

--- Comment #4 from Richard Biener  ---
Author: rguenth
Date: Mon Jul 29 11:38:46 2019
New Revision: 273876

URL: https://gcc.gnu.org/viewcvs?rev=273876&root=gcc&view=rev
Log:
2019-07-29  Richard Biener  

PR tree-optimization/91257
* tree-vrp.c (operand_less_p): Avoid dispatching to fold for
most cases, instead call compare_values which handles the
symbolic ranges we handle specially.
(compare_values_warnv): Do not call operand_less_p but open-code
the effective fold calls.  Avoid converting so much.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-vrp.c

[Bug middle-end/91267] [10 regression] SEGV in value_range_base::equal_p

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91267

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #12 from Richard Biener  ---
Fixed.

[Bug lto/91273] [7/8/9/10 Regression] ICE in warn_types_mismatch at ipa-devirt.c:995

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91273

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.5

[Bug middle-end/91283] [10 regression] gcc.dg/torture/c99-contract-1.c FAILs

2019-07-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91283

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-07-29
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Created attachment 46635
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46635&action=edit
gcc10-pr91283.patch

Untested fix.

[Bug tree-optimization/91201] [7/8/9/10 Regression] SIMD not generated for horizontal sum of bytes in array

2019-07-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91201

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
With the OpenMP directives and -fopenmp-simd we already do vectorize this, as
loop->force_vectorize loops aren't unrolled until after vectorization.

[Bug tree-optimization/91280] [8/9/10 Regression] ICE in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259 since r260354

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91280

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.4

[Bug tree-optimization/91280] [8/9/10 Regression] ICE in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259 since r260354

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91280

--- Comment #2 from Martin Liška  ---
(In reply to Richard Biener from comment #1)
> Hmm, this has earlier errors:
> 
> t.ii:123:20: error: invalid use of incomplete type ‘class
> TensorMap, 0>’
>   123 |   static const int NumInputDims = H ArgType::Dimensions>::value;
>   |^~~~
> 
> so - too much testcase reduction?

Yep. It's interesting that I don't see the error when I configure a compiler
with --enable-checking=release. Lemme investigate that.

> 
> But yeah, I can see what goes wrong - get_constraint_for_component_ref
> doesn't expect get_constraint_for_1 on the base, here MEM[&decl + 16],
> to return multiple constraints but when decl has subvars then if
> &decl + 16 is not exactly at a subvar we'll include the next as well.

[Bug c/91285] New: _Pragma does not work in a useful fashion

2019-07-29 Thread konrad.schwarz at siemens dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

Bug ID: 91285
   Summary: _Pragma does not work in a useful fashion
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: konrad.schwarz at siemens dot com
  Target Milestone: ---

Consider the following code:

# defineENCLOSING_OBJECT(TYPE, MEMBER, OBJECT)\
(sizeof (&((TYPE *) 0)->MEMBER - OBJECT),\
(TYPE *) ((char *) OBJECT - offsetof (TYPE, MEMBER)))

What this does is find the address of an "enclosing object" given the
address of one of its members MEMBER as OBJECT.
This can be useful when interacting with
programming frameworks -- often, MEMBER is actually the first element
of the application-defined object, but this macro is generic enough
that it doesn't have to be so.

As an additional compile-time type-safety check, the macro expansion 
includes an additional clause that ensures that OBJECT is indeed of the
type of MEMBER by subtracting its address from a synthesized enclosing
objects member's address;
this subtraction is done as the argument of sizeof(), ensuring
it doesn't actually get executed at run-time.

Newer versions of GCC flag this construct with an "unused value" warning,
which can be disabled globally with
# pragma GCC diagnostic ignored "-Wunused-value".

In general however, the unused value warning is useful, so one
would like to restrict the scope of ignoring the warning to as
small an area as possible.  The GCC diagnostic pragmas allow this
to be done with the `diagnostic push' and `diagnostic pop'
sub-commands.

In C90, one would have to add # pragma directives around each use
of the macro, clearly an undesirable approach.  Hence, in C0x,
_Pragma was introduced to allow pragma directives to
result as a by-product of macro expansion.

Thus, the C0x solution would be to extend the definition of the macro
with
_Pragma ("GCC diagnostic push")\
_Pragma ("GCC diagnostic ignored \"-Wunused-value\"")\
-- original macro text --\
_Pragma ("GCC diagnostic pop")

However, GCC fails to compile this, because it can't handle
pragmas in the middle of expressions.

This makes the GCC implementation of _Pragma worthless.

[Bug libstdc++/51333] [7/8/9/10 Regression] cxxabi.h incompatible with -fkeep-inline-functions at link time

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51333

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
  Known to work||4.4.7
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
   Target Milestone|--- |7.5
Summary|cxxabi.h incompatible with  |[7/8/9/10 Regression]
   |-fkeep-inline-functions at  |cxxabi.h incompatible with
   |link time   |-fkeep-inline-functions at
   ||link time
  Known to fail||10.0, 4.5.4, 7.4.0, 8.3.0,
   ||9.1.0

[Bug c++/91286] New: invalid use of incomplete type depends on --enable-checking=release

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91286

Bug ID: 91286
   Summary: invalid use of incomplete type depends on
--enable-checking=release
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

If you consider test-case from
https://gcc.gnu.org/bugzilla/attachment.cgi?id=46632

I see:
$ g++ batch.ii -c 
batch.ii: In instantiation of ‘const int TensorEvaluator, 1>
>, int>::NumInputDims’:
batch.ii:124:30:   required from ‘const int TensorEvaluator, 1>
>, int>::NumDims’
batch.ii:125:24:   required from ‘struct TensorEvaluator, 1>
>, int>’
batch.ii:128:8:   required from ‘struct TensorEvaluator, 1> >, int>’
batch.ii:147:40:   required from ‘struct TensorEvaluator, 1> >, const TensorContractionOp, TensorChippingOp<1,
TensorMap, 0> >, TensorChippingOp<1,
TensorMap, 0> >, int> >, int>’
batch.ii:165:5:   required from here
batch.ii:123:20: error: invalid use of incomplete type ‘const class
TensorMap, 1>’
  123 |   static const int NumInputDims = H::value;
  |^~~~
batch.ii:18:60: note: declaration of ‘class
TensorMap, 1>’
   18 | template  class = B> class TensorMap;
  |^
batch.ii: In instantiation of ‘const int TensorEvaluator, 0> >,
int>::NumInputDims’:
batch.ii:124:30:   required from ‘const int TensorEvaluator, 0> >,
int>::NumDims’
batch.ii:125:24:   required from ‘struct TensorEvaluator, 0> >,
int>’
batch.ii:128:8:   required from ‘struct TensorEvaluator, 0> >, int>’
batch.ii:93:41:   required from ‘struct
TensorContractionEvaluatorBase, TensorChippingOp<1,
TensorMap, 0> >, TensorChippingOp<1,
TensorMap, 0> >, int>, int> >’
batch.ii:99:8:   required from ‘struct TensorEvaluator, TensorChippingOp<1,
TensorMap, 0> >, TensorChippingOp<1,
TensorMap, 0> >, int>, int>’
batch.ii:148:41:   required from ‘struct TensorEvaluator, 1> >, const TensorContractionOp, TensorChippingOp<1,
TensorMap, 0> >, TensorChippingOp<1,
TensorMap, 0> >, int> >, int>’
batch.ii:165:5:   required from here
batch.ii:123:20: error: invalid use of incomplete type ‘class
TensorMap, 0>’
  123 |   static const int NumInputDims = H::value;
  |^~~~
batch.ii:18:60: note: declaration of ‘class
TensorMap, 0>’
   18 | template  class = B> class TensorMap;
  |^
batch.ii: In lambda function:
batch.ii:246:54: warning: no return statement in function returning non-void
[-Wreturn-type]
  246 | I registrar__body__1__object([](int *) -> A * { K(); });
  |  ^

with a compiler configure with:
../configure --enable-languages=c,c++,lto,fortran --disable-multilib
--prefix=/home/marxin/bin/gcc2 --disable-bootstrap --without-isl
--disable-libsanitizer

and 

$ g++ batch.ii -c -fchecking
batch.ii: In lambda function:
batch.ii:246:54: warning: no return statement in function returning non-void
[-Wreturn-type]
  246 | I registrar__body__1__object([](int *) -> A * { K(); });
  |   

with:
../configure --enable-languages=c,c++,lto,fortran --disable-multilib
--prefix=/home/marxin/bin/gcc2 --disable-bootstrap --without-isl
--disable-libsanitizer --enable-checking=release

[Bug other/91284] Gcc for aarch64 binaries

2019-07-29 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91284

Richard Earnshaw  changed:

   What|Removed |Added

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

--- Comment #1 from Richard Earnshaw  ---
This bugzilla is for reporting bugs.  If you have questions you wish to ask,
please mail gcc-h...@gcc.gnu.org.

[Bug middle-end/91282] gcc.dg/type-convert-var.c FAILs

2019-07-29 Thread tnfchris at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91282

Tamar Christina  changed:

   What|Removed |Added

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

--- Comment #1 from Tamar Christina  ---
32-bit x86 and m68k have a different FLT_EVAL_METHOD by default so I'll skip
the test on them, but x86_64-*-*-* shouldn't be failing and I can't reproduce
it locally.

s390 seems to work but the testsuite adds `-ansi` to the test which for some
reason changes flt_eval_method to FLT_EVAL_METHOD_PROMOTE_TO_DOUBLE which
`excess_precision_type` to give a different answer.

Yet the output of the test still uses floats.

This seems like a target bug? I can't tell if it's by design or not so I can
skip  the test on this target too when `-ansi` if that's the expected result.

[Bug lto/91287] New: LTO disables linking with scalar MASS library (Fortran only)

2019-07-29 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287

Bug ID: 91287
   Summary: LTO disables linking with scalar MASS library (Fortran
only)
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wschmidt at gcc dot gnu.org
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

The MASS (Mathematical Acceleration Subsystem) libraries provide alternatives
to math functions in libm.  We've discovered that when compiling a Fortran
program with -flto, the program is linked with libm rather than with the MASS
functions, leading to a degradation in performance versus not using -flto.

luoxhu@genoa test_mass $ cat hellofortran.f90
recursive subroutine square_cube(i,isquare,icube)
  integer, intent(in)  :: i ! input
  integer, intent(out) :: isquare,icube ! output
  !square = i**2
  isquare = atan2 (real(i), real(2))
  icube   = i**3
  if(i == 8) return
  call square_cube(i+1,isq,icub)
end subroutine square_cube

program xx
  implicit none
  integer :: i,isq,icub
  i = 1
  call square_cube(i,isq,icub)
  print*,"i,i^2,i^3=",i,isq,icub
end program xx

luoxhu@genoa test_mass $ cat build_fortran.sh
echo "mass without  lto"
~/local/gcc_t/bin/gfortran -O3 -mcpu=power9 hellofortran.f90 -mveclibabi=mass
-L/opt/mass/8.1.3/Linux_LE/lib/ -lmass
nm a.out |grep atan2
echo "mass link with lto"
~/local/gcc_t/bin/gfortran -O3 -mcpu=power9 hellofortran.f90 -mveclibabi=mass
-L/opt/mass/8.1.3/Linux_LE/lib/ -lmass -flto
nm a.out |grep atan2

luoxhu@genoa test_mass $ ./build_fortran.sh
mass without  lto
1a40 T atan2f
1a40 T _atan2f
mass link with lto
16f0 t 01f8.plt_call.atan2f@@GLIBC_2.17
 U atan2f@@GLIBC_2.17


The issue appears to occur during the "visibility" pass:

no-lto: (always __builtin_atan2f)
  hellofortran.f90.013t.ompexp: _3 = __builtin_atan2f (_2, 2.0e+0);
  hellofortran.f90.018t.fixup_cfg1: _3 = __builtin_atan2f (_2, 2.0e+0);
lto: (__builtin_atan2f -> atan2f )
  hellofortran.f90.013t.ompexp: _3 = __builtin_atan2f (_2, 2.0e+0);
  hellofortran.f90.016i.visibility:atan2/3 (atan2) @0x3fffb53e0708
  hellofortran.f90.018t.fixup_cfg1: _3 = atan2f (_2, 2.0e+0);

We've observed that the problem does not occur with a similar C/C++ test case. 
It's not clear to me whether this is an LTO problem or a Fortran front end
problem.

Thanks to Luo Xiong Hu for the test case and initial investigation.

[Bug lto/91287] LTO disables linking with scalar MASS library (Fortran only)

2019-07-29 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287

Bill Schmidt  changed:

   What|Removed |Added

   Keywords||lto, wrong-code
 Target||ppc64*-*-*
 CC||tkoenig at gcc dot gnu.org
   Target Milestone|--- |10.0

[Bug lto/91288] New: [8/9/10 Regression] ICE in add_symbol_to_partition_1, at lto/lto-partition.c:153 since r249224

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91288

Bug ID: 91288
   Summary: [8/9/10 Regression] ICE in add_symbol_to_partition_1,
at lto/lto-partition.c:153 since r249224
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
CC: hubicka at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Starting from the revision we ICE on:

$ gcc -c 2.ii && g++ 2.o 1.ii -flto -O2 
1.ii:42:45: warning: dynamic exception specifications are deprecated in C++11
[-Wdeprecated]
   42 |   InetAddr(const std::basic_string &) throw(FWException,
  | ^
1.ii:48:48: warning: dynamic exception specifications are deprecated in C++11
[-Wdeprecated]
   48 | InetAddr::InetAddr(const basic_string &) throw(FWException,
  |^
lto1: internal compiler error: in add_symbol_to_partition_1, at
lto/lto-partition.c:153
0x5aaef9 add_symbol_to_partition_1
/home/marxin/Programming/gcc/gcc/lto/lto-partition.c:153
0x7e0fc2 add_symbol_to_partition_1
/home/marxin/Programming/gcc/gcc/lto/lto-partition.c:215
0x7e31c6 lto_balanced_map(int, int)
/home/marxin/Programming/gcc/gcc/lto/lto-partition.c:596
0x7da0af do_whole_program_analysis
/home/marxin/Programming/gcc/gcc/lto/lto.c:482
0x7da0af lto_main()
/home/marxin/Programming/gcc/gcc/lto/lto.c:628
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

[Bug lto/91288] [8/9/10 Regression] ICE in add_symbol_to_partition_1, at lto/lto-partition.c:153 since r249224

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91288

--- Comment #1 from Martin Liška  ---
Created attachment 46636
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46636&action=edit
1.ii

[Bug lto/91288] [8/9/10 Regression] ICE in add_symbol_to_partition_1, at lto/lto-partition.c:153 since r249224

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91288

--- Comment #2 from Martin Liška  ---
Created attachment 46637
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46637&action=edit
2.ii

[Bug libgomp/91256] openmp crash in shutdown

2019-07-29 Thread Danack at basereality dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91256

--- Comment #2 from Danack at basereality dot com ---
Apparently this might be fixable by calling:

omp_pause_resource_all(omp_pause_hard);

However, that function is only defined in OpenMP version 5, which isn't
available in the versions of GCC that people use, and won't be for many years.

So interim fixes are still desired, that are hopefully more robust than adding
usleep calls and hoping for the best.

[Bug target/91150] [10 Regression] wrong code with -O -mavx512vbmi due to wrong writemask

2019-07-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91150

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-07-29
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Created attachment 46638
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46638&action=edit
gcc10-pr91150.patch

On the #c0 testcase it regressed with r270908, but as the testcase in the patch
shows, this is a wrong-code since GCC 5 (introduction of -mavx512bw).

[Bug libstdc++/91259] Parenthesize requires clauses that contain expressions that are not just a value of type bool

2019-07-29 Thread david at doublewise dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91259

David Stone  changed:

   What|Removed |Added

 CC||david at doublewise dot net

--- Comment #6 from David Stone  ---
Sorry, I thought I had seen the usage somewhere else but it turns out I was
mistaken and it was enable_if. Thanks for fixing.

[Bug tree-optimization/91257] [7/8/9/10 Regression] Compile-time and memory-hog hog

2019-07-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91257

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Mon Jul 29 14:19:07 2019
New Revision: 273877

URL: https://gcc.gnu.org/viewcvs?rev=273877&root=gcc&view=rev
Log:
2019-07-29  Richard Biener  

PR tree-optimization/91257
* tree-ssa-sccvn.h (struct vn_avail): New.
(struct vn_ssa_aux): Add avail member.
* tree-ssa-sccvn.c (class rpo_elim): Remove m_rpo_avail
member, add m_avail_freelist one.
(rpo_elim::~rpo_elim): Remove.
(rpo_elim::eliminate_avail): Adjust to new avail tracking
data structure.
(rpo_elim::eliminate_push_avail): Likewise.
(do_unwind): Likewise.
(do_rpo_vn): Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-sccvn.c
trunk/gcc/tree-ssa-sccvn.h

[Bug libstdc++/51333] [7/8/9/10 Regression] cxxabi.h incompatible with -fkeep-inline-functions at link time

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51333

--- Comment #8 from Jonathan Wakely  ---
Author: redi
Date: Mon Jul 29 14:27:19 2019
New Revision: 273878

URL: https://gcc.gnu.org/viewcvs?rev=273878&root=gcc&view=rev
Log:
PR libstdc++/51333 Define recursive_init_error constructor non-inline

The recursive_init_error class is defined in a header, with an inline
constructor, but the definition of the vtable and destructor are not
exported from the shared library. With -fkeep-inline-functions the
constructor gets emitted in user code, and requires the (non-exported)
vtable. This fails to link.

As far as I can tell, the recursive_init_error class definition was
moved into  so it could be documented with Doxygen, not for
any technical reason. But now it's there (and documented), somebody
could be relying on it, by catching that type and possibly performing
derived-to-base conversions to the std::exception base class. So the
conservative fix is to leave the class definition in the header but make
the constructor non-inline. This still allows the type to be caught and
still defines its base class. User code can no longer construct objects
of that type, but that's not something we need to support.

PR libstdc++/51333
* libsupc++/cxxabi.h (__gnu_cxx::recursive_init_error): Do not define
constructor inline.
* libsupc++/guard_error.cc (__gnu_cxx::recursive_init_error): Define
constructor.
* testsuite/18_support/51333.cc: New test.

Added:
trunk/libstdc++-v3/testsuite/18_support/51333.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/libsupc++/cxxabi.h
trunk/libstdc++-v3/libsupc++/guard_error.cc

[Bug libstdc++/51333] [7/8/9/10 Regression] cxxabi.h incompatible with -fkeep-inline-functions at link time

2019-07-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51333

--- Comment #9 from Jonathan Wakely  ---
Fixed on trunk so far.

[Bug c/91285] _Pragma does not work in a useful fashion

2019-07-29 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

--- Comment #1 from Andrew Pinski  ---
Isn't it better to do:

# defineENCLOSING_OBJECT(TYPE, MEMBER, OBJECT)\
((void)sizeof (&((TYPE *) 0)->MEMBER - OBJECT),\
(TYPE *) ((char *) OBJECT - offsetof (TYPE, MEMBER)))

Instead?

[Bug libstdc++/91259] Parenthesize requires clauses that contain expressions that are not just a value of type bool

2019-07-29 Thread Casey at Carter dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91259

--- Comment #7 from Casey Carter  ---
Thanks, Jonathan. I can confirm that grepping for "\b(concept|requires)\b"
finds a great many uses in comments, but only the one concept definition and
one requires-clause in .

[Bug c/91192] [9/10 regression] non-deterministic ICE on invalid

2019-07-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91192

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug c/91285] _Pragma does not work in a useful fashion

2019-07-29 Thread konrad.schwarz at siemens dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

--- Comment #2 from Konrad Schwarz  ---
Thank you for your suggestion -- it does indeed work.

However, this is a workaround for this specific problem --
other pragmas cannot be handled in this way --
consider # pragma GCC optimize ... or # pragma align ...
or # pragma longcall (although the last two
apply to declarations).

[Bug tree-optimization/91227] pointer relational expression not folded but equivalent inequality is

2019-07-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91227

--- Comment #15 from Martin Sebor  ---
I agree that comparison of the intptr_t values would be preferable over
extending the pointer inequality semantics.  It's the intended mechanism for
this sort query.  It makes code that relies on the ordering of unrelated
objects easy to distinguish from accidental pointer misuses, which in turn
makes it possible to both detect bugs and emit better object code.

[Bug c/91192] [9/10 regression] non-deterministic ICE on invalid

2019-07-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91192

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-07-29
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Created attachment 46639
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46639&action=edit
gcc10-pr91192.patch

Untested fix.

[Bug tree-optimization/91157] [10 Regression] ICE: verify_gimple failed (error: position plus size exceeds size of referenced object in 'bit_field_ref')

2019-07-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91157

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug middle-end/91190] [10 Regression] ICE on valid code: in hashtab_chk_error, at hash-table.c:137

2019-07-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91190

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug target/91289] New: powerpc-eabi: Usage of -fstack-limit-symbol leads to internal compiler error during RTL pass

2019-07-29 Thread philipp.spilger at kip dot uni-heidelberg.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91289

Bug ID: 91289
   Summary: powerpc-eabi: Usage of -fstack-limit-symbol leads to
internal compiler error during RTL pass
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: philipp.spilger at kip dot uni-heidelberg.de
  Target Milestone: ---

Created attachment 46640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46640&action=edit
Preprocessed source triggering the error

Compilation of
```
int test() { return 0; }
```
with `powerpc-eabi-gcc-9.1.0 -Wall -Wextra -ffreestanding
-fstack-limit-symbol=symbol_name -c test.c`

leads to the internal compiler error:

```
test.c: In function 'test':
test.c:3:1: error: insn does not satisfy its constraints:
3 | }
  | ^
(insn 17 16 18 (set (reg:SI 0 0)
(lo_sum:SI (reg:SI 0 0)
(const (plus:SI (symbol_ref:SI ("symbol_name"))
(const_int 16 [0x10]) "test.c":1:12 700 {elf_low}
 (nil))
during RTL pass: final
test.c:3:1: internal compiler error: in final_scan_insn_1, at final.c:3013
0x5a8c18 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.c:108
0x5a8c3e _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/gcc/rtl-error.c:118
0x59c796 final_scan_insn_1
../../gcc/gcc/final.c:3013
0x7cefc8 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc/gcc/final.c:3153
0x7cf28c final_1
../../gcc/gcc/final.c:2021
0x7cfcc4 rest_of_handle_final
../../gcc/gcc/final.c:4659
0x7cfcc4 execute
../../gcc/gcc/final.c:4737
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
```

The gcc-9.1.0 is built with the following options: (gcc --verbose)
```
Using built-in specs.
COLLECT_GCC=powerpc-eabi-gcc-9.1.0
COLLECT_LTO_WRAPPER=/fasthome/pspilger/gcc/install/libexec/gcc/powerpc-eabi/9.1.0/lto-wrapper
Target: powerpc-eabi
Configured with: ../gcc/configure --prefix=/fasthome/pspilger/gcc/install
--target=powerpc-eabi --enable-languages=c,c++ --disable-shared --enable-lto
--with-float=soft --without-headers --disable-threads --disable-decimal-float
--disable-multilib --disable-nls --disable-libstdcxx --disable-libgomp
--disable-libvtv --disable-libatomic --disable-libmpx --disable-libquadmath
--disable-libssp
Thread model: single
gcc version 9.1.0 (GCC) 
```

The problem also occurs with gcc-8.1.0, but does not occur with gcc-4.9.4.

[Bug c++/91290] New: pragma maybe-uninitialized does not propagate to lambda

2019-07-29 Thread mickg at mickg dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91290

Bug ID: 91290
   Summary: pragma maybe-uninitialized does not propagate to
lambda
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mickg at mickg dot net
  Target Milestone: ---

Using gcc 9.1.1 and 10.x:
Seems like during inlining, pragmas are not propagated to the inlined code.

Reproduction:
g++ -Wall -Wextra -O2 
(https://wandbox.org/permlink/UuZJvwuiuv0aXOaJ) -select and unselect
optimization for reproduction.


template 
int foo(int argc, char** argv, F&& f){
#pragma GCC diagnostic push  
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
int k;
if (argv[argc-1]) k=argc;
return f(k);
#pragma GCC diagnostic pop
}

auto inner(const int& k) { return k*k; }

int main(int argc, char** argv) {
[[maybe_unused]] auto lambda = [](const auto& k) { return inner(k);};
//return foo(argc,argv,inner); //This does compile with -O0 and -O1
return foo(argc,argv,lambda); //This does _not_ compile with -O1, but does
with -O0
}

[Bug testsuite/91258] [10 regression] g++.dg/ubsan/vla-1.C and gcc.dg/strlenopt-70.c fail starting with r273783

2019-07-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91258

--- Comment #7 from Martin Sebor  ---
We need to put a breakpoint in the block below in
strlen_check_and_optimize_stmt and print the lhs node and its type (p
debug_tree (lhs)) to explain how is_char_store is set to true for the
unexpected argument (i.e., for int).  I tried it on my powerpc64 machine but
could reproduce it there.  My powerpc64le machine is unreachable and I'm not
sure when I'll have access to it.

else if (TREE_CODE (lhs) != SSA_NAME && !TREE_SIDE_EFFECTS (lhs))
  {
tree type = TREE_TYPE (lhs);
if (TREE_CODE (type) == ARRAY_TYPE)
  type = TREE_TYPE (type);

bool is_char_store = is_char_type (type);
if (!is_char_store && TREE_CODE (lhs) == MEM_REF)
  {
/* To consider stores into char objects via integer types
   other than char but not those to non-character objects,
   determine the type of the destination rather than just
   the type of the access.  */
tree ref = TREE_OPERAND (lhs, 0);
type = TREE_TYPE (ref);
if (TREE_CODE (type) == POINTER_TYPE)
  type = TREE_TYPE (type);
if (TREE_CODE (type) == ARRAY_TYPE)
  type = TREE_TYPE (type);
if (is_char_type (type))
  is_char_store = true;
  }

/* Handle a single or multibyte assignment.  */
if (is_char_store && !handle_store (gsi))
  return false;
  }


When I print LHS I get something like this:

 
unit-size 
align:32 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
0x3fffaf230738 precision:32 min  max

pointer_to_this >

arg:0 
public unsigned DI
size 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set -1
structural-equality>
visited var 
def_stmt ar.0_18 = __builtin_alloca_with_align (_16, 32);
version:18
ptr-info 0x3fffaf20ab00>
arg:1 
constant 0>
/src/gcc/trunk/gcc/testsuite/g++.dg/ubsan/vla-1.C:6:24 start:
/src/gcc/trunk/gcc/testsuite/g++.dg/ubsan/vla-1.C:6:24 finish:
/src/gcc/trunk/gcc/testsuite/g++.dg/ubsan/vla-1.C:6:24>


The first call to is_char_type() returns false and it's a MEM_REF so the code
tries to look at the first operand.  That's a pointer to an array, so the code
extracts the type of the array element which is int, and calls is_char_store()
with it again, and it again returns false, so handle_store() is not called.

[Bug fortran/90813] [10 regression] gfortran.dg/proc_ptr_51.f90 fails (SIGSEGV) after 272084

2019-07-29 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90813

--- Comment #33 from Thomas Koenig  ---
Author: tkoenig
Date: Mon Jul 29 17:45:24 2019
New Revision: 273880

URL: https://gcc.gnu.org/viewcvs?rev=273880&root=gcc&view=rev
Log:
2019-07-29  Thomas Koenig  

PR fortran/90813
* dump-parse-tree.c (show_global_symbol): New function.
(gfc_dump_global_symbols): New function.
* gfortran.h (gfc_traverse_gsymbol): Add prototype.
(gfc_dump_global_symbols): Likewise.
* invoke.texi: Document -fdump-fortran-global.
* lang.opt: Add -fdump-fortran-global.
* parse.c (gfc_parse_file): Handle flag_dump_fortran_global.
* symbol.c (gfc_traverse_gsymbol): New function.
* trans-decl.c (sym_identifier): New function.
(mangled_identifier): New function, doing most of the work
of gfc_sym_mangled_identifier.
(gfc_sym_mangled_identifier): Use mangled_identifier.  Add mangled
identifier to global symbol table.
(get_proc_pointer_decl): Use backend decl from global identifier
if present.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/dump-parse-tree.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/invoke.texi
trunk/gcc/fortran/lang.opt
trunk/gcc/fortran/parse.c
trunk/gcc/fortran/symbol.c
trunk/gcc/fortran/trans-decl.c

[Bug ipa/89330] IPA inliner touches released cgraph_edges

2019-07-29 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89330

Andreas Schwab  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #18 from Andreas Schwab  ---
This breaks bootstrap with --enable-checking=release.

during IPA pass: cp
../../gcc/gcc/tree-ssa-sccvn.c:7307:1: internal compiler error: in
speculative_call_info, at cgraph.c:1114
 7307 | }
  | ^
0xc0dc0e cgraph_edge::speculative_call_info(cgraph_edge*&, cgraph_edge*&,
ipa_ref*&)
../../gcc/gcc/cgraph.c:1114
0xc0ddbb cgraph_edge::resolve_speculation(tree_node*)
../../gcc/gcc/cgraph.c:1155
0xc0e025 cgraph_edge::make_direct(cgraph_node*)
../../gcc/gcc/cgraph.c:1215
0xefefaa ipa_make_edge_direct_to_target(cgraph_edge*, tree_node*, bool)
../../gcc/gcc/ipa-prop.c:2978
0x1eb40da ipcp_discover_new_direct_edges
../../gcc/gcc/ipa-cp.c:3348
0x1eb55b9 create_specialized_node
../../gcc/gcc/ipa-cp.c:3913
0x1eb731f decide_whether_version_node
../../gcc/gcc/ipa-cp.c:4803
0x1eb77c7 ipcp_decision_stage
../../gcc/gcc/ipa-cp.c:4915
0x1eb7fd6 ipcp_driver
../../gcc/gcc/ipa-cp.c:5092
0x1eb81b8 execute
../../gcc/gcc/ipa-cp.c:5183

[Bug middle-end/91242] ICE on aarch64 SVE tests - gcc.target/aarch64/sve/clastb_[146].c

2019-07-29 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91242

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

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

--- Comment #9 from rsandifo at gcc dot gnu.org  
---
Fixed in r273880, PR number added in r273882

[Bug target/70320] msp430 asm volatile does not accept lower-case register names in clobber list

2019-07-29 Thread jozefl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70320

--- Comment #1 from jozefl at gcc dot gnu.org ---
Author: jozefl
Date: Mon Jul 29 19:21:18 2019
New Revision: 273883

URL: https://gcc.gnu.org/viewcvs?rev=273883&root=gcc&view=rev
Log:
Allow both upper and lower case 'r' in register names

2019-07-29  Jozef Lawrynowicz  

PR target/70320
* config/msp430/msp430.h: Define ADDITIONAL_REGISTER_NAMES.

2019-07-29  Jozef Lawrynowicz  

PR target/70320
* gcc.target/msp430/asm-register-names-lower-case.c: New test.
* gcc.target/msp430/asm-register-names-upper-case.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.target/msp430/asm-register-names-lower-case.c
trunk/gcc/testsuite/gcc.target/msp430/asm-register-names-upper-case.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/msp430/msp430.h
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/91201] [7/8/9/10 Regression] SIMD not generated for horizontal sum of bytes in array

2019-07-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91201

--- Comment #5 from Marc Glisse  ---
It looks like a convoluted way to write:

unsigned char sum() 
{
  unsigned char res=0;
  unsigned char*p=(unsigned char*)bytes;
  for(int n=0;n

[Bug tree-optimization/91291] New: [10 regression] gcc.dg/20020312-2.c FAILs

2019-07-29 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91291

Bug ID: 91291
   Summary: [10 regression] gcc.dg/20020312-2.c FAILs
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ro at gcc dot gnu.org
CC: rguenth at gcc dot gnu.org
  Target Milestone: ---
Target: sparc-sun-solaris2.11, i?86-*-*, x86_64-*-*,
powerpc64le-unknown-linux-gnu, s390x-ibm-linux-gnu

Between 20190728 (r273850) and 20190729 (r273879), gcc.dg/20020312-2.c started
to FAIL:

+FAIL: gcc.dg/20020312-2.c (internal compiler error)
+FAIL: gcc.dg/20020312-2.c (test for excess errors)
+UNRESOLVED: gcc.dg/20020312-2.c compilation failed to produce executable

I'm seeing it on 32-bit Solaris/x86 and 32 and 64-bit Solaris/SPARC; there are
also reports for several other x86 targets, powerpc64le, and s390x.

during GIMPLE pass: fre
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/20020312-2.c: In function 'f':
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/20020312-2.c:181:1: internal
compiler error: tree check: expected ssa_name, have integer_cst in VN_INFO, at
tree-ssa-sccvn.c:380
0x9433c7f tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/vol/gcc/src/hg/trunk/local/gcc/tree.c:9905
0x92fa221 tree_check(tree_node*, char const*, int, char const*, tree_code)
/vol/gcc/src/hg/trunk/local/gcc/tree.h:3257
0x92fa221 VN_INFO(tree_node*)
/vol/gcc/src/hg/trunk/local/gcc/tree-ssa-sccvn.c:380
0x92ebd31 rpo_elim::eliminate_push_avail(basic_block_def*, tree_node*)
/vol/gcc/src/hg/trunk/local/gcc/tree-ssa-sccvn.c:6266
0x92ed1f1 eliminate_dom_walker::eliminate_stmt(basic_block_def*,
gimple_stmt_iterator*)
/vol/gcc/src/hg/trunk/local/gcc/tree-ssa-sccvn.c:5815
0x92f4f83 process_bb
/vol/gcc/src/hg/trunk/local/gcc/tree-ssa-sccvn.c:6654
0x92f67f4 do_rpo_vn
/vol/gcc/src/hg/trunk/local/gcc/tree-ssa-sccvn.c:7138
0x92f7a94 execute
/vol/gcc/src/hg/trunk/local/gcc/tree-ssa-sccvn.c:7292

This is probably caused by r273877:

2019-07-29  Richard Biener  

PR tree-optimization/91257
* tree-ssa-sccvn.h (struct vn_avail): New.
(struct vn_ssa_aux): Add avail member.
* tree-ssa-sccvn.c (class rpo_elim): Remove m_rpo_avail
member, add m_avail_freelist one.
(rpo_elim::~rpo_elim): Remove.
(rpo_elim::eliminate_avail): Adjust to new avail tracking
data structure.
(rpo_elim::eliminate_push_avail): Likewise.
(do_unwind): Likewise.
(do_rpo_vn): Likewise.

[Bug middle-end/91283] [10 regression] gcc.dg/torture/c99-contract-1.c FAILs

2019-07-29 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91283

--- Comment #2 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #1 from Jakub Jelinek  ---
> Created attachment 46635
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46635&action=edit
> gcc10-pr91283.patch
>
> Untested fix.

FWIW, I've bootstrapped with the fix included and all supported
languages enabled (i.e. also ada, d, go) on i386-pc-solaris2.11 and
sparc-sun-solaris2.11: no regressions and the 32-bit x86 failure is gone.

[Bug c++/91292] New: Mangler incorrectly handles negative numbers in expressions

2019-07-29 Thread jorg.brown at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91292

Bug ID: 91292
   Summary: Mangler incorrectly handles negative numbers in
expressions
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jorg.brown at gmail dot com
  Target Milestone: ---

Consider these four templated functions, each using an enable_if:

template
typename std::enable_if<(int)sizeof(T) >= -(1), int>::type size1(T *t);

template
typename std::enable_if<(int)sizeof(T) >= -1, int>::type size2(T *t);

template
typename std::enable_if<(int)sizeof(T) >= -(1.), int>::type size3(T *t);

template
typename std::enable_if<(int)sizeof(T) >= -1., int>::type size4(T *t);



According to http://itanium-cxx-abi.github.io/cxx-abi/abi.html#expressions , a
negative number isn't treated as a negative literal; it is a negated number. 
This means that it is mangled as though it were positive, and then its negation
is mangled.  So -1 and -(1) are treated the same.

Separately, if the number is a floating-point number, gcc seems to mangle them
all the same: into (double)[] , which is actually a NaN.

See https://godbolt.org/z/qIYbgQ for a repro using gcc 9.1.  Currently the four
routines above are mangled by gcc into: (after demangling)

std::enable_if<((int)(sizeof (int)))>=(-(1)), int>::type size1(int*)
std::enable_if<((int)(sizeof (int)))>=(-1), int>::type size2(int*)
std::enable_if<((int)(sizeof (int)))>=(-((double)[3ff0])),
int>::type size3(int*)
std::enable_if<((int)(sizeof (int)))>=((double)[]), int>::type
size4(int*)

[Bug tree-optimization/91293] New: Wrong code with -O3

2019-07-29 Thread vsevolod.livinskij at frtk dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91293

Bug ID: 91293
   Summary: Wrong code with -O3
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vsevolod.livinskij at frtk dot ru
  Target Milestone: ---

GCC produces wrong code with -O3 option.

Reproducer:
#include 

long long a;
unsigned b, c;
int d = 62;

void e(long long *f, int p2) { *f = p2; }
int main() {
  for (int g = 2; g <= d; g++) {
c += 5 - g;
b += g + 4;
  }
  e(&a, b);
  printf("%llu\n", a);
}

Error:
>$ gcc -march=skylake-avx512 -O3 small.c ; ./a.out
18446744073709550508
>$ gcc -march=skylake-avx512 -O0 small.c ; ./a.out
2196

GCC version: 10.0.0 (rev. 273839)

[Bug tree-optimization/91294] New: [10 Regression] wrong strlen result of a conditional with an offset

2019-07-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91294

Bug ID: 91294
   Summary: [10 Regression] wrong strlen result of a conditional
with an offset
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

r273783 committed last week to resolve pr91183 introduced a couple of bugs into
the strlen pass: when copying the result of a conditional expression involving
source strings of different lengths into a destination containing a string, the
length of the result isn't computed correctly.  Instead of using the length of
the shorter of the two source strings (adjusted for any offset into the
destination) as the lower bound of the result the optimization use the length
of the shorter source (again adjusted for any offset into the destination) as
the exact length of the result.  The program below includes two test cases, one
for each instance of this bug (it's in two places).

$ cat z.c && gcc -O2 -Wall z.c && ./a.out
const char s[] = "76543210\0\0";
const char t[] = "01234567\0\0";

char a[16], b[16];

int i = 0;

int f (void)
{
  __builtin_memcpy (a, i ? s + 2 : t + 1, 8);

  return __builtin_strlen (a);
}

int g (void)
{
  __builtin_strcpy (b, "12345678");
  __builtin_strcat (b, "9a");
  __builtin_memcpy (b + 6, i ? "78\0" : "789\0", 4);

  return __builtin_strlen (b);
}

int main (void)
{
  __builtin_printf ("strlen (\"%s\") = %i\n", a, f ());
  __builtin_printf ("strlen (\"%s\") = %i\n", b, g ());
}
strlen ("1234567") = 6
strlen ("123456789") = 8

[Bug tree-optimization/91294] [10 Regression] wrong strlen result of a conditional with an offset

2019-07-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91294

Martin Sebor  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-07-30
 Blocks||83819
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
   Target Milestone|--- |10.0
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
I'm testing a patch.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83819
[Bug 83819] [meta-bug] missing strlen optimizations

[Bug c++/90538] [9/10 Regression] Redeclaration error when expanding parameter pack multiple times in a lambda

2019-07-29 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90538

Jason Merrill  changed:

   What|Removed |Added

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

[Bug lto/91287] LTO disables linking with scalar MASS library (Fortran only)

2019-07-29 Thread luoxhu at cn dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287

--- Comment #1 from Xiong Hu XS Luo  ---
Martin's commit 4ee64e30659a9125a47eeea882d8044e690ce334 will cause ICE.

It's a REGRESSION not related to this current issue.

~/local/gcc_t/bin/gfortran -O3 -mcpu=power9 hellofortran.f90 -mveclibabi=mass
-L/opt/mass/8.1.3/Linux_LE/lib/ -lmass -flto -lmass_simdp8 -lmassv -lmassvp8
lto1: internal compiler error: bytecode stream: expected tag identifier_node
instead of LTO_UNKNOWN

It's not fixed even updated to commit cf474017fbb8fbb71d69b0ca4b4b34260cfe5ab3
(Mon Jul 29, Fix ICE seen in tree-ssa-dce.c for new/delete pair.).


commit 4ee64e30659a9125a47eeea882d8044e690ce334
Author: marxin 
Date:   Thu Jul 25 09:36:38 2019 +

Extend DCE to remove unnecessary new/delete-pairs (PR c++/23383).

2019-07-25  Martin Liska  

[Bug debug/91295] New: [gdb] program crashed with segementation fault when set breakpoint at address

2019-07-29 Thread yangyibiao at nju dot edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91295

Bug ID: 91295
   Summary: [gdb] program crashed with segementation fault when
set breakpoint at address
   Product: gcc
   Version: 8.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yangyibiao at nju dot edu.cn
  Target Milestone: ---

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
8.3.0-6ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-8
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --with-target-system-zlib --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1~18.04.1) 

$ gdb -v
GNU gdb (Ubuntu 8.2-0ubuntu1~18.04) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ cat small.c
#include 

int main()
{
  for (int *p = (int[]){ 1, 2, 3, 0 }; /* { dg-error "array" } */
   *p; ++p) {
printf("%d\n", *p);
  }
  return 0;
}

$ gcc -g small.c && gdb -batch -x cmds a.out
Breakpoint 1 at 0x553

Program received signal SIGSEGV, Segmentation fault.
0x77a05980 in __vdso_platform_setup () at
../sysdeps/unix/sysv/linux/x86_64/init-first.c:36
36  ../sysdeps/unix/sysv/linux/x86_64/init-first.c: No such file or
directory.
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[Inferior 1 (process 6324) killed]


##
Error: gdb set breakpoint and program crashed wiht segmentation fault
##

$ cat cmds
break *_init+0xb
run
kill
q

[Bug tree-optimization/91201] [7/8/9/10 Regression] SIMD not generated for horizontal sum of bytes in array

2019-07-29 Thread bisqwit at iki dot fi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91201

--- Comment #6 from Joel Yliluoma  ---
Maybe a horizontal checksum is a bit obscure term. A 8-bit checksum is what is
being accomplished, nonetheless. Yes, there are simpler ways to do it…

But I tried a number of different approaches in order to try and get maximum
performance SIMD code out of GCC, and I came upon this curious case that I
posted this bugreport about.

To another compiler, I reported a related bug concerning a code that looks like
this:

unsigned char calculate_checksum(const void* ptr)
{
unsigned char bytes[16], result = 0;
memcpy(bytes, ptr, 16);
// The reason the memcpy is there in place is because to
// my knowledge, it is the only _safe_ way permitted by
// the standard to do conversions between representations.
// Union, pointer casting, etc. are not safe.
for(unsigned n=0; n<16; ++n) result += bytes[n];
return result;
}

After my report, their compiler now generates:

vmovdqu xmm0, xmmword ptr [rdi]
vpshufd xmm1, xmm0, 78 # xmm1 = xmm0[2,3,0,1]
vpaddb xmm0, xmm0, xmm1
vpxor xmm1, xmm1, xmm1
vpsadbw xmm0, xmm0, xmm1
vpextrb eax, xmm0, 0
ret

This is what GCC generates for the same code.

vmovdqu xmm0, XMMWORD PTR [rdi]
vpsrldq xmm1, xmm0, 8
vpaddb  xmm0, xmm0, xmm1
vpsrldq xmm1, xmm0, 4
vpaddb  xmm0, xmm0, xmm1
vpsrldq xmm1, xmm0, 2
vpaddb  xmm0, xmm0, xmm1
vpsrldq xmm1, xmm0, 1
vpaddb  xmm0, xmm0, xmm1
vpextrb eax, xmm0, 0
ret

So the bottom line is, (v)psadbw reductions should be added as M. Glisse
correctly indicated.

[Bug fortran/91296] New: ICE when passing complex number %re/%im as a procedure argument with -Waliasing.

2019-07-29 Thread chinoune.mehdi at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91296

Bug ID: 91296
   Summary: ICE when passing complex number %re/%im as a procedure
argument with -Waliasing.
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chinoune.mehdi at hotmail dot com
  Target Milestone: ---

This code throw an ICE

module m
  implicit none
  integer, parameter :: sp = selected_real_kind(6)

contains
  pure subroutine s(a,b,c)
real(sp), intent(in) :: a, b
real(sp), intent(out) :: c
c = a + b
  end subroutine s
end module m

program test
  use m
  implicit none
  real(sp) :: a
  complex(sp) :: c

  c = (1._sp,1._sp)
  call s(c%re,c%im,a)
  print*,a

end program test

$ gfortran-9 -Waliasing -c test.f90
f951: internal compiler error: compare_actual_expr(): Bad component code   
  Please submit a full bug report, 
   
with preprocessed source if appropriate.   
  See
 for instructions.

[Bug tree-optimization/91026] switch expansion produces a jump table with trivial entries

2019-07-29 Thread peter at cordes dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91026

Peter Cordes  changed:

   What|Removed |Added

 CC||peter at cordes dot ca

--- Comment #3 from Peter Cordes  ---
(In reply to Martin Liška from comment #2)
> Switch conversion bails out because it knowns that a jump table (or a bit
> test can) be used for this snippet. Then we prefer to use a jump table then
> a bit test. With -fno-jump-tables we generate the same code.
> That said, I confirm it's a small limitation.

This regression appeared in GCC9 for this test-case, and is present in GCC9.1
on Godbolt: https://godbolt.org/z/fDjTxN

bool is_vowel(char c) {
switch (c) {
case 'a': case 'e': case 'i': case 'o': case 'u': case 'y':
  return 1;
default:
  return 0;
}
}


But simplifying it

 case 'a': case 'e': case 'i':

to those 3 cases gets gcc9 and trunk to use an immediate bitmap.

With gcc8 and earlier, the x86-64 asm for the 2 versions is identical except
for the immediate used with TEST EAX, imm32.



(And BTW, there's a missed optimization here of using  mask & (1<>n) & 1.  Or better, looking for that conversion in user source code /
logic because people often write tests that way requiring the creation of an
actual 1 in a register.

Or for ISAs with flags, have the mask already right-shifted by 1 so the bit
shifted out is the one we want.  Then CF = result with no extra test.

Also an x86 missed optimization: BT reg,reg is very efficient (single uop) on
Intel and Ryzen, and avoids needing a 3-uop-on-Intel shift-by-CL or a mov reg,1

I'll report these ideas separately if/when I get around to it.

[Bug debug/91295] [gdb] program crashed with segementation fault when set breakpoint at address

2019-07-29 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91295

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This is not a bug.  You are putting a break point inside a multiple byte
instruction.  Changing the behavior of the problem.

On x86_64, instructions are variable length and gdb allows you to put a break
point anywhere.

[Bug tree-optimization/91280] [8/9/10 Regression] ICE in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259 since r260354

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91280

Martin Liška  changed:

   What|Removed |Added

  Attachment #46632|0   |1
is obsolete||

--- Comment #3 from Martin Liška  ---
Created attachment 46641
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46641&action=edit
Reduced test-case w/o errors

[Bug ipa/89330] IPA inliner touches released cgraph_edges

2019-07-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89330

--- Comment #19 from Martin Liška  ---
(In reply to Andreas Schwab from comment #18)
> This breaks bootstrap with --enable-checking=release.
> 
> during IPA pass: cp
> ../../gcc/gcc/tree-ssa-sccvn.c:7307:1: internal compiler error: in
> speculative_call_info, at cgraph.c:1114
>  7307 | }
>   | ^
> 0xc0dc0e cgraph_edge::speculative_call_info(cgraph_edge*&, cgraph_edge*&,
> ipa_ref*&)
> ../../gcc/gcc/cgraph.c:1114
> 0xc0ddbb cgraph_edge::resolve_speculation(tree_node*)
> ../../gcc/gcc/cgraph.c:1155
> 0xc0e025 cgraph_edge::make_direct(cgraph_node*)
> ../../gcc/gcc/cgraph.c:1215
> 0xefefaa ipa_make_edge_direct_to_target(cgraph_edge*, tree_node*, bool)
> ../../gcc/gcc/ipa-prop.c:2978
> 0x1eb40da ipcp_discover_new_direct_edges
> ../../gcc/gcc/ipa-cp.c:3348
> 0x1eb55b9 create_specialized_node
> ../../gcc/gcc/ipa-cp.c:3913
> 0x1eb731f decide_whether_version_node
> ../../gcc/gcc/ipa-cp.c:4803
> 0x1eb77c7 ipcp_decision_stage
> ../../gcc/gcc/ipa-cp.c:4915
> 0x1eb7fd6 ipcp_driver
> ../../gcc/gcc/ipa-cp.c:5092
> 0x1eb81b8 execute
> ../../gcc/gcc/ipa-cp.c:5183

Confirmed, I've got a patch candidate that I'll send soon.