[Bug tree-optimization/81240] [7/8 Regression] ICE in dfs_enumerate_from

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81240

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #3 from Jeffrey A. Law  ---
Fixed by one of Richi's tree-vrp fixes from the summer.

   2017-08-17  Richard Biener  

* tree-vrp.c (vrp_int_const_binop): Do not set *overflow_p
to true when overflow is undefined and we saturated the
result.

[Bug target/83358] [8 Regression] division not converted with Intel tuning since r253934

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83358

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #5 from Jeffrey A. Law  ---
Fixed by Markus's patch on the trunk.

[Bug target/83358] [8 Regression] division not converted with Intel tuning since r253934

2017-12-15 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83358

--- Comment #4 from Jeffrey A. Law  ---
Author: law
Date: Sat Dec 16 04:28:08 2017
New Revision: 255739

URL: https://gcc.gnu.org/viewcvs?rev=255739=gcc=rev
Log:
2017-12-15  Markus Trippelsdorf  

PR target/83358
* config/i386/x86-tune-costs.h (skylake_cost, core_cost): Increase
div/mod latencies a bit.

PR target/83358
* gcc.target/i386/pr83358-1.c: New test.
* gcc.target/i386/pr83358-2.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr83358-1.c
trunk/gcc/testsuite/gcc.target/i386/pr83358-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/x86-tune-costs.h
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/78394] False positives of maybe-uninitialized with -Og

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394

--- Comment #7 from Jeffrey A. Law  ---
-O0 has none of the analysis necessary and I believe you get no warnings at
all.

A minimum of -Og is needed, but -Og is inherently going to give many false
positives.

[Bug tree-optimization/78394] False positives of maybe-uninitialized with -Og

2017-12-15 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394

--- Comment #6 from Eric Gallager  ---
(In reply to Jeffrey A. Law from comment #5)
> Well, -Og doesn't do any of the detailed analysis and optimization that
> would give the compiler the opportunity to eliminate the paths that result
> in the false positive.  So it's no great surprise.

-O0 doesn't do any of that detailed analysis or optimization either, but it
doesn't have the same issue of warning like -Og

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #8 from Eric Gallager  ---
(In reply to Markus Trippelsdorf from comment #2)
> I think casting to/from void* (*)() should always be silently accepted.
> Or perhaps the warning should not be enabled even for -Wextra like clang's
> -Wbad-function-cast. (BTW why didn't you use that name?)

GCC already has a warning by that name; I asked about it in October and this
was Bernd's response: https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00250.html

[Bug c++/81197] [7 Regression] ICE with structured binding and lifetime-extended temporaries

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81197

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Sat Dec 16 00:40:14 2017
New Revision: 255735

URL: https://gcc.gnu.org/viewcvs?rev=255735=gcc=rev
Log:
Backported from mainline
2017-12-15  Jakub Jelinek  

PR c++/81197
* cp-tree.h (cp_maybe_mangle_decomp): Declare.
* decl.c (cp_maybe_mangle_decomp): New function.
(cp_finish_decomp): Don't SET_DECL_ASSEMBLER_NAME here.
* parser.c (cp_convert_range_for,
cp_parser_decomposition_declaration): Call cp_maybe_mangle_decomp.
* pt.c (tsubst_expr): Likewise.
* mangle.c (find_decomp_unqualified_name): New function.
(write_unqualified_name): Handle DECL_DECOMPOSITION_P
where DECL_ASSEMBLER_NAME is already set.

* g++.dg/cpp1z/decomp34.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp34.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-tree.h
branches/gcc-7-branch/gcc/cp/decl.c
branches/gcc-7-branch/gcc/cp/mangle.c
branches/gcc-7-branch/gcc/cp/parser.c
branches/gcc-7-branch/gcc/cp/pt.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/83205] ICE on structured binding with ill-formed negative std::tuple_size::value

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83205

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Sat Dec 16 00:41:10 2017
New Revision: 255736

URL: https://gcc.gnu.org/viewcvs?rev=255736=gcc=rev
Log:
Backported from mainline
2017-12-15  Jakub Jelinek  

PR c++/83205
* decl.c (cp_finish_decomp): Handle the case when tsize is not
error_mark_node, but doesn't fit into uhwi.  Split up count != eltscnt
and !tree_fits_uhwi_p (tsize) error_at calls into error_n and inform_n
to handle plural forms properly.

* g++.dg/cpp1z/decomp3.C: Adjust for structured binding count
mismatch diagnostics split into error and warning with plural
forms.
* g++.dg/cpp1z/decomp10.C: Likewise.
* g++.dg/cpp1z/decomp32.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp32.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/decl.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp10.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp3.C

[Bug tree-optimization/78394] False positives of maybe-uninitialized with -Og

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com

--- Comment #5 from Jeffrey A. Law  ---
Well, -Og doesn't do any of the detailed analysis and optimization that would
give the compiler the opportunity to eliminate the paths that result in the
false positive.  So it's no great surprise.

[Bug middle-end/24639] [meta-bug] bug to track all Wuninitialized issues

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
Bug 24639 depends on bug 69026, which changed state.

Bug 69026 Summary: dwarf2out.c:4295 warning: 
‘finder[...]addr_table_entry_struct_union::label’ may be used uninitialized
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69026

   What|Removed |Added

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

[Bug middle-end/69026] dwarf2out.c:4295 warning: ‘finder[...]addr_table_entry_struct_union::label’ may be used uninitialized

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69026

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||law at redhat dot com
 Resolution|--- |FIXED

--- Comment #3 from Jeffrey A. Law  ---
Per c#2.

[Bug middle-end/61409] [6 regression] -Wmaybe-uninitialized false-positive with -O2

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61409

--- Comment #29 from Jeffrey A. Law  ---
Nevermind my last comment.  Totally wrong.   This is fixed on the trunk,
totally and completely by Aldy's changes.

The trunk changed in that it can thread the jump now because we'll be under
growth limits, which is a good thing as well.

Ignore my last comment entirely.

[Bug middle-end/61409] [6 regression] -Wmaybe-uninitialized false-positive with -O2

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61409

--- Comment #28 from Jeffrey A. Law  ---
So this is "fixed" on the trunk. 

The trunk now has the ability to track statements that will likely become dead
code as a result of jump threading.  That's enough to get the provided samples
under the code growth limitations.

Of course, all you have to do to is insert a couple more statements that can
not be removed as a result of jump threading and the warning is back.

So I'm leaving state as-is.

For reference, this testcase ought to trigger the problem now.  If growth
limitations are ever changed the test may need further tweaking.


void *init(void);

struct window
{
  int line_height;
  int pixel_width;
  int pixel_height;
  int column_width;
  int text_cols;
  int internal_border_width;
  int left_fringe_width, right_fringe_width;
} *rw;

void bar() __attribute__((noreturn));
void f(int i, int j) {
void *ptr;
if (i)
  {
if (j)
  return; /* bar(); */
ptr = init();
  }
rw->pixel_width = ((rw->text_cols * (rw->column_width))
   + (rw->left_fringe_width + (rw->right_fringe_width)) + 2
* (rw->internal_border_width));
  rw->pixel_height = ((rw->text_cols * (rw->line_height)));
  foo ();
  foo ();
  foo ();
  foo ();
  if (i)
{
  rw=ptr;
}
}

[Bug middle-end/24639] [meta-bug] bug to track all Wuninitialized issues

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
Bug 24639 depends on bug 42145, which changed state.

Bug 42145 Summary: bogus "may be used uninitialized" (a || b converted to a|b)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145

   What|Removed |Added

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

[Bug tree-optimization/42145] bogus "may be used uninitialized" (a || b converted to a|b)

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #15 from Jeffrey A. Law  ---
This was fixed today on the trunk.

[Bug middle-end/20968] spurious "may be used uninitialized" warning (conditional PHIs)

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20968
Bug 20968 depends on bug 36550, which changed state.

Bug 36550 Summary: Wrong "may be used uninitialized" warning (conditional PHIs)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36550

   What|Removed |Added

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

[Bug middle-end/24639] [meta-bug] bug to track all Wuninitialized issues

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
Bug 24639 depends on bug 36550, which changed state.

Bug 36550 Summary: Wrong "may be used uninitialized" warning (conditional PHIs)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36550

   What|Removed |Added

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

[Bug middle-end/36550] Wrong "may be used uninitialized" warning (conditional PHIs)

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36550

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #18 from Jeffrey A. Law  ---
Fixed on the trunk.

[Bug middle-end/36550] Wrong "may be used uninitialized" warning (conditional PHIs)

2017-12-15 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36550

--- Comment #17 from Jeffrey A. Law  ---
Author: law
Date: Fri Dec 15 22:35:51 2017
New Revision: 255731

URL: https://gcc.gnu.org/viewcvs?rev=255731=gcc=rev
Log:
PR tree-optimization/36550
* tree-ssa-threadupdate.c (count_stmts_and_phis_in_block): New.
(mark_threaded_blocks): Rewrite code to avoid block copying when
optimizing for size.  Don't pessimize blocks which will be
copied, but all the statements will be dead.

PR tree-optimization/36550
* gcc.dg/tree-ssa/pr36550.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr36550.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-threadupdate.c

[Bug c++/83217] Compiler segfault: structured binding by reference to a templated type via a pointer

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83217

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:16:15 2017
New Revision: 255730

URL: https://gcc.gnu.org/viewcvs?rev=255730=gcc=rev
Log:
PR c++/83217
* decl.c (cp_finish_decomp): If decl's type is REFERENCE_TYPE,
call complete_type (TREE_TYPE (type)).

* g++.dg/cpp1z/decomp33.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp33.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/decl.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/83269] [6/7 Regression] Wrong constant folding

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83269

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:15:30 2017
New Revision: 255729

URL: https://gcc.gnu.org/viewcvs?rev=255729=gcc=rev
Log:
PR tree-optimization/83269
* fold-const.c (fold_binary_loc): Perform (-A) - B -> (-B) - A
subtraction in arg0's type if type is signed and arg0 is unsigned.
Formatting fix.

* gcc.c-torture/execute/pr83269.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/execute/pr83269.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/fold-const.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/83198] [7 regression] ICE in format_floating, at gimple-ssa-sprintf.c:1900

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83198

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:14:41 2017
New Revision: 255728

URL: https://gcc.gnu.org/viewcvs?rev=255728=gcc=rev
Log:
Backported from mainline
2017-12-14  Jakub Jelinek  

PR tree-optimization/83198
* gimple-ssa-sprintf.c (format_floating): Set type solely based on
dir.modifier, regardless of TREE_TYPE (arg).  Assume non-REAL_CST
value if arg is a REAL_CST with incompatible type.

* gcc.dg/pr83198.c: New test.
* gcc.dg/tree-ssa/pr83198.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr83198.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/tree-ssa/pr83198.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/gimple-ssa-sprintf.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/81165] [8 Regression] Regression in GCC-8.0.0's optimizer

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81165

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #18 from Jeffrey A. Law  ---
Fixed by the changes I committed for Alex.

[Bug tree-optimization/19794] [meta-bug] Jump threading related bugs

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19794
Bug 19794 depends on bug 81165, which changed state.

Bug 81165 Summary: [8 Regression] Regression in GCC-8.0.0's optimizer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81165

   What|Removed |Added

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

[Bug c++/79650] [6/7 Regression] ICE on invalid c++ code with label arithmetic in convert_nontype_argument (pt.c:6515)

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79650

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:13:37 2017
New Revision: 255727

URL: https://gcc.gnu.org/viewcvs?rev=255727=gcc=rev
Log:
Backported from mainline
2017-12-14  Jakub Jelinek  

PR c++/79650
* pt.c (convert_nontype_argument): Diagnose
reduced_constant_expression_p expressions that aren't INTEGER_CST.

* g++.dg/template/pr79650.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/template/pr79650.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/pt.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/80631] [6/7 Regression] Compiling with -O3 -mavx2 gives wrong code

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80631

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:12:46 2017
New Revision: 255726

URL: https://gcc.gnu.org/viewcvs?rev=255726=gcc=rev
Log:
Backported from mainline
2017-12-12  Jakub Jelinek  

PR tree-optimization/80631
* tree-vect-loop.c (get_initial_def_for_reduction): Fix comment typo.
(vect_create_epilog_for_reduction): Add INDUC_VAL argument, for
INTEGER_INDUC_COND_REDUCTION use INDUC_VAL instead of
hardcoding zero as the value if COND_EXPR is never true.  For
INTEGER_INDUC_COND_REDUCTION don't emit the final COND_EXPR if
INDUC_VAL is equal to INITIAL_DEF.
(vectorizable_reduction): Compute INDUC_VAL for
vect_create_epilog_for_reduction, if no value is suitable, don't
use INTEGER_INDUC_COND_REDUCTION for now.  Formatting fixes.

* gcc.dg/vect/pr80631-1.c: New test.
* gcc.dg/vect/pr80631-2.c: New test.

PR tree-optimization/80631
* gcc.target/i386/avx2-pr80631.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/pr80631-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/pr80631-2.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/avx2-pr80631.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-vect-loop.c

[Bug target/81906] [7 Regression] Calls to rint() wrongly optimized away starting in g++ 6

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81906

--- Comment #16 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:11:33 2017
New Revision: 255725

URL: https://gcc.gnu.org/viewcvs?rev=255725=gcc=rev
Log:
Backported from mainline
2017-12-08  Joseph Myers  
Alexander Monakov  
Jakub Jelinek  

PR target/81906
* config/i386/i386.c (ix86_expand_rint): Handle flag_rounding_math.

* gcc.target/i386/pr81906.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr81906.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/i386.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/81165] [8 Regression] Regression in GCC-8.0.0's optimizer

2017-12-15 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81165

--- Comment #17 from Jeffrey A. Law  ---
Author: law
Date: Fri Dec 15 22:11:06 2017
New Revision: 255724

URL: https://gcc.gnu.org/viewcvs?rev=255724=gcc=rev
Log:
PR tree-optimization/81165
* tree-ssa-threadupdate.c (uses_in_bb): New.
(estimate_threading_killed_stmts): New.
* tree-ssa-threadupdate.h (estimate_threading_killed_stmts): Prototype.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts_at_dest): Expand limit
when its hit.

PR tree-optimization/81165
* gcc.dg/pr81165.c: New.

Added:
trunk/gcc/testsuite/gcc.dg/pr81165.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-threadedge.c
trunk/gcc/tree-ssa-threadupdate.c
trunk/gcc/tree-ssa-threadupdate.h

[Bug c++/80259] [6/7 Regression] ICE deleting friend function

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80259

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:10:40 2017
New Revision: 255723

URL: https://gcc.gnu.org/viewcvs?rev=255723=gcc=rev
Log:
Backported from mainline
2017-12-06  Jakub Jelinek  

PR c++/80259
* decl2.c (grokfield): Diagnose = delete redefinition of a friend.

* g++.dg/cpp0x/pr80259.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/pr80259.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/decl2.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug sanitizer/81212] [6/7 Regression] -Wreturn-type is disabled when used together with -fsanitize=return

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81212

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:09:50 2017
New Revision: 255722

URL: https://gcc.gnu.org/viewcvs?rev=255722=gcc=rev
Log:
Backported from mainline
2017-12-02  Jakub Jelinek  

PR c++/81212
* tree-cfg.c (pass_warn_function_return::execute): Handle
__builtin_ubsan_handle_missing_return like __builtin_unreachable
with BUILTINS_LOCATION.

* g++.dg/ubsan/pr81212.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/ubsan/pr81212.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-cfg.c

[Bug target/78643] [6/7 Regression] ICE in convert_move, at expr.c:230

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78643

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:09:07 2017
New Revision: 255721

URL: https://gcc.gnu.org/viewcvs?rev=255721=gcc=rev
Log:
Backported from mainline
2017-12-02  Jakub Jelinek  

PR target/78643
PR target/80583
* expr.c (get_inner_reference): If DECL_MODE of a non-bitfield
is BLKmode for vector field with vector raw mode, use TYPE_MODE
instead of DECL_MODE.

* gcc.target/i386/pr80583.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr80583.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/80583] [6/7 Regression] ICE with target attribute and vectorized float: internal compiler error: in convert_move, at expr.c:270

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80583

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:09:07 2017
New Revision: 255721

URL: https://gcc.gnu.org/viewcvs?rev=255721=gcc=rev
Log:
Backported from mainline
2017-12-02  Jakub Jelinek  

PR target/78643
PR target/80583
* expr.c (get_inner_reference): If DECL_MODE of a non-bitfield
is BLKmode for vector field with vector raw mode, use TYPE_MODE
instead of DECL_MODE.

* gcc.target/i386/pr80583.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr80583.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/80819] [6/7 regression] Useless store to the stack in _mm_set_epi64x with SSE4 -mno-avx

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80819

--- Comment #13 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:08:20 2017
New Revision: 255720

URL: https://gcc.gnu.org/viewcvs?rev=255720=gcc=rev
Log:
Backported from mainline
2017-11-29  Jakub Jelinek  

PR target/80819
* config/i386/sse.md (vec_concatv2di): Remove * from (=Yr,0,*rm)
alternative.

* gcc.target/i386/pr80819-1.c: New test.
* gcc.target/i386/pr80819-2.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr80819-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr80819-2.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/sse.md
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/81888] [7 Regression] Structured bindings stopped working

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81888

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:07:23 2017
New Revision: 255719

URL: https://gcc.gnu.org/viewcvs?rev=255719=gcc=rev
Log:
Backported from mainline
2017-11-27  Jakub Jelinek  

PR c++/81888
* parser.c (cp_parser_decomposition_declaration): Reject just
BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
than all such CONSTRUCTORs, and only if is_direct_init is true.

* g++.dg/cpp1z/decomp30.C: Add a test for structured binding with
= {} and = { a, a } initializers.
* g++.dg/cpp1z/decomp31.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp31.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/parser.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp30.C

[Bug c++/81675] [6/7 Regression] attribute(noreturn) of destructor in :? not honored

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81675

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:06:16 2017
New Revision: 255718

URL: https://gcc.gnu.org/viewcvs?rev=255718=gcc=rev
Log:
Backported from mainline
2017-11-27  Jakub Jelinek  

PR c++/81675
* cp-gimplify.c (cp_fold) : Don't return immediately
for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
through into normal folding, otherwise just rebuild x if any op
changed.

* g++.dg/warn/pr81675.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/pr81675.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-gimplify.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug rtl-optimization/81553] [7 Regression] ICE in immed_wide_int_const, at emit-rtl.c:607

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81553

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:05:00 2017
New Revision: 255717

URL: https://gcc.gnu.org/viewcvs?rev=255717=gcc=rev
Log:
Backported from mainline
2017-11-25  Jakub Jelinek  

PR rtl-optimization/81553
* combine.c (simplify_if_then_else): In (if_then_else COND (OP Z C1) Z)
to (OP Z (mult COND (C1 * STORE_FLAG_VALUE))) optimization, if OP
is a shift where C1 has different mode than the whole shift, use C1's
mode for MULT rather than the shift's mode.

* gcc.c-torture/compile/pr81553.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/compile/pr81553.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/combine.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/81304] [6/7 Regression] Bogus warning with -Wsurprising and -fopenmp: Type specified for intrinsic function 'min' / 'max'

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81304

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 22:00:48 2017
New Revision: 255716

URL: https://gcc.gnu.org/viewcvs?rev=255716=gcc=rev
Log:
Backported from mainline
2017-11-24  Jakub Jelinek  

PR fortran/81304
* trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
attr.implicit_type in intrinsic_sym to avoid undesirable warning.

* testsuite/libgomp.fortran/pr81304.f90: New test.

Added:
branches/gcc-7-branch/libgomp/testsuite/libgomp.fortran/pr81304.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/trans-openmp.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/libgomp/ChangeLog

[Bug sanitizer/83014] ICE in pretty-print with -fsanitize=bounds

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83014

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:58:13 2017
New Revision: 255715

URL: https://gcc.gnu.org/viewcvs?rev=255715=gcc=rev
Log:
Backported from mainline
2017-11-24  Jakub Jelinek  

PR sanitizer/83014
* ubsan.c (ubsan_type_descriptor): Use pp_unsigned_wide_integer
instead of pp_printf with HOST_WIDE_INT_PRINT_DEC.  Avoid calling
tree_to_uhwi twice.

* gcc.dg/ubsan/pr83014.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/ubsan/pr83014.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/ubsan.c

[Bug fortran/81841] [6/7 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81841

--- Comment #16 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:55:47 2017
New Revision: 255712

URL: https://gcc.gnu.org/viewcvs?rev=255712=gcc=rev
Log:
Backported from mainline
2017-11-23  Dirk Broemmel  
Jakub Jelinek  

PR fortran/81841
* parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
BLOCK DATA.

* libgomp.fortran/pr81841.f90: New test.

Added:
branches/gcc-7-branch/libgomp/testsuite/libgomp.fortran/pr81841.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/parse.c
branches/gcc-7-branch/libgomp/ChangeLog

[Bug middle-end/82253] [6/7 Regression] ICE in convert_move, at expr.c:604

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82253

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:54:15 2017
New Revision: 255711

URL: https://gcc.gnu.org/viewcvs?rev=255711=gcc=rev
Log:
Backported from mainline
2017-11-23  Jakub Jelinek  

PR middle-end/82253
* expr.c (expand_assignment): For CONCAT to_rtx, complex type from and
bitpos/bitsize covering the whole destination, use store_expr only if
the complex mode is the same.  Otherwise, use expand_normal and if
it returns CONCAT, subreg each part separately instead of trying to
subreg the whole result.

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

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/pr82253.f90
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug debug/83084] [7 Regression] -fcompare-debug failure on ppc64le

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83084

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:53:29 2017
New Revision: 255710

URL: https://gcc.gnu.org/viewcvs?rev=255710=gcc=rev
Log:
Backported from mainline
2017-11-22  Jakub Jelinek  

PR debug/83084
* valtrack.c (propagate_for_debug_subst, propagate_for_debug): Reset
debug insns if they would contain UNSPEC_VOLATILE or volatile asm.
(dead_debug_insert_temp): Likewise, but also ignore even non-volatile
asm.

* g++.dg/opt/pr83084.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/opt/pr83084.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/valtrack.c

[Bug target/82880] [6/7 Regression] gcc --help=target --help=optimizers hangs on mips

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82880

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:52:06 2017
New Revision: 255709

URL: https://gcc.gnu.org/viewcvs?rev=255709=gcc=rev
Log:
Backported from mainline
2017-11-21  James Cowgill  
Jakub Jelinek  

PR target/82880
* config/mips/frame-header-opt.c (mips_register_frame_header_opt):
Remove static keyword from f variable.

* gcc.dg/opts-8.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/opts-8.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/mips/frame-header-opt.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/83059] ICE on invalid C++ code: in tree_to_uhwi, at tree.c:6633

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83059

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:50:52 2017
New Revision: 255708

URL: https://gcc.gnu.org/viewcvs?rev=255708=gcc=rev
Log:
Backported from mainline
2017-11-21  Jakub Jelinek  

PR c++/83059
* c-common.c (get_atomic_generic_size): Use TREE_INT_CST_LOW
instead of tree_to_uhwi, formatting fix.

* c-c++-common/pr83059.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/pr83059.c
Modified:
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-common.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/82781] [6/7 Regression] Vector extension operators return wrong result in constexpr

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82781

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:50:00 2017
New Revision: 255707

URL: https://gcc.gnu.org/viewcvs?rev=255707=gcc=rev
Log:
Backported from mainline
2017-11-20  Jakub Jelinek  

PR c++/82781
* constexpr.c (cxx_eval_vector_conditional_expression): New function.
(cxx_eval_constant_expression) : Use it instead
of cxx_eval_conditional_expression.

* g++.dg/ext/constexpr-pr82781.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/constexpr-pr82781.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/constexpr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/81197] [7 Regression] ICE with structured binding and lifetime-extended temporaries

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81197

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[7/8 Regression] ICE with   |[7 Regression] ICE with
   |structured binding and  |structured binding and
   |lifetime-extended   |lifetime-extended
   |temporaries |temporaries

--- Comment #5 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug c++/83205] ICE on structured binding with ill-formed negative std::tuple_size::value

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83205

--- Comment #3 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug c++/83205] ICE on structured binding with ill-formed negative std::tuple_size::value

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83205

--- Comment #2 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:40:45 2017
New Revision: 255706

URL: https://gcc.gnu.org/viewcvs?rev=255706=gcc=rev
Log:
PR c++/83205
* decl.c (cp_finish_decomp): Handle the case when tsize is not
error_mark_node, but doesn't fit into uhwi.  Split up count != eltscnt
and !tree_fits_uhwi_p (tsize) error_at calls into error_n and inform_n
to handle plural forms properly.

* g++.dg/cpp1z/decomp3.C: Adjust for structured binding count
mismatch diagnostics split into error and warning with plural
forms.
* g++.dg/cpp1z/decomp10.C: Likewise.
* g++.dg/cpp1z/decomp32.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/decomp32.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp1z/decomp10.C
trunk/gcc/testsuite/g++.dg/cpp1z/decomp3.C

[Bug c++/81197] [7/8 Regression] ICE with structured binding and lifetime-extended temporaries

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81197

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 21:39:20 2017
New Revision: 255705

URL: https://gcc.gnu.org/viewcvs?rev=255705=gcc=rev
Log:
PR c++/81197
* cp-tree.h (cp_maybe_mangle_decomp): Declare.
* decl.c (cp_maybe_mangle_decomp): New function.
(cp_finish_decomp): Don't SET_DECL_ASSEMBLER_NAME here.
* parser.c (cp_convert_range_for,
cp_parser_decomposition_declaration): Call cp_maybe_mangle_decomp.
* pt.c (tsubst_expr): Likewise.
* mangle.c (find_decomp_unqualified_name): New function.
(write_unqualified_name): Handle DECL_DECOMPOSITION_P
where DECL_ASSEMBLER_NAME is already set.

* g++.dg/cpp1z/decomp34.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/decomp34.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/mangle.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug lto/83201] [7/8 Regression] SPEC CPU2017 505.mcf_r produces incorrect output when built with -flto and FDO

2017-12-15 Thread pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83201

--- Comment #6 from Pat Haugen  ---
So I did a bisect of trunk during the GCC 7 development timeframe
(r235035-r247017) and it pointed to r236878 as the point where the failure
started.


+++ gcc/ChangeLog   (revision 236878)
@@ -1,3 +1,9 @@
+2016-05-30  Jan Hubicka  
+
+   * tree-ssa-loop-ivcanon.c (try_peel_loop): Correctly set wont_exit
+   for peeled copies; avoid underflow when updating estimates; correctly
+   scale loop profile.
+

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

Bernd Edlinger  changed:

   What|Removed |Added

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

--- Comment #7 from Bernd Edlinger  ---
Yes, in C++ "void (*) ()" means exactly the same as "void (*) (void)"
so that should be guaranteed to suppress the warning here.

IMHO when casting between completely unrelated function types
this warning is justified and often points out a potential problem.

[Bug tree-optimization/83440] New: Internal compiler error: in vect_transform_stmt, at tree-vect-stmts.c:8692

2017-12-15 Thread geir at cray dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83440

Bug ID: 83440
   Summary: Internal compiler error: in vect_transform_stmt, at
tree-vect-stmts.c:8692
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: geir at cray dot com
  Target Milestone: ---

At -O3 optimization (and 'march=corei7-avx') getting an ICE with the attached
test case.  Works OK with -O2.



$ g++ --version   
g++ (GCC) 7.2.0 20170814 (Cray Inc.) 
Copyright (C) 2017 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions.  There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
$ g++ -march=corei7-avx -c -std=c++17 -O2 thr.i 
$ g++ -march=corei7-avx -c -std=c++17 -O3 thr.i 
In file included from
/opt/gcc/7.2.0/snos/include/g++/bits/shared_ptr_atomic.h:33:0,
 from /opt/gcc/7.2.0/snos/include/g++/memory:82,
 from /opt/gcc/7.2.0/snos/include/g++/functional:4375,
 from
/opt/gcc/7.2.0/snos/lib/gcc/x86_64-suse-linux/7.2.0/include-fixed/limits.h:746,
 from /opt/gcc/7.2.0/snos/include/g++/cstdlib:2310,
 from
/opt/gcc/7.2.0/snos/include/g++/bits/stream_iterator.h:3060,
 from /opt/gcc/7.2.0/snos/include/g++/istream:993,
 from /opt/gcc/7.2.0/snos/include/g++/bits/basic_ios.h:519,
 from
/opt/gcc/7.2.0/snos/include/g++/x86_64-suse-linux/bits/ctype_base.h:73,
 from /opt/gcc/7.2.0/snos/include/g++/streambuf:850,
 from /opt/gcc/7.2.0/snos/include/g++/bits/ios_base.h:1079,
 from
/opt/gcc/7.2.0/snos/include/g++/bits/locale_classes.h:857,
 from
/opt/gcc/7.2.0/snos/include/g++/ext/string_conversions.h:166,
 from /opt/gcc/7.2.0/snos/include/g++/bits/basic_string.h:6159,
 from /opt/gcc/7.2.0/snos/include/g++/string:52,
 from /opt/gcc/7.2.0/snos/include/g++/bits/locale_classes.h:40,
 from /opt/gcc/7.2.0/snos/include/g++/bits/ios_base.h:41,
 from /opt/gcc/7.2.0/snos/include/g++/ios:42,
 from /opt/gcc/7.2.0/snos/include/g++/istream:38,
 from
/opt/gcc/7.2.0/snos/lib/gcc/x86_64-suse-linux/7.2.0/include/stddef.h:943,
 from /opt/gcc/7.2.0/snos/include/g++/cstddef:1218,
 from /opt/gcc/7.2.0/snos/include/g++/vector:69,
 from thr.cpp:1:
/opt/gcc/7.2.0/snos/include/g++/backward/auto_ptr.h: In function 'void
thrust::system::detail::sequential::radix_sort_detail::radix_sort(thrust::system::detail::sequential::execution_policy&,
RandomAccessIterator1, RandomAccessIterator2, RandomAccessIterator3,
RandomAccessIterator4, size_t) [with unsigned int RadixBits = 8; bool HasValues
= true; DerivedPolicy = thrust::system::cpp::detail::par_t;
RandomAccessIterator1 = thrust::detail::normal_iterator; RandomAccessIterator2 = thrust::detail::normal_iterator
>; RandomAccessIterator3 =
thrust::zip_iterator > >, thrust::detail::normal_iterator > > > >; RandomAccessIterator4 =
thrust::detail::normal_iterator, thrust::tuple >, thrust::system::cpp::detail::par_t,
thrust::use_default, thrust::use_default> >]':
/opt/gcc/7.2.0/snos/include/g++/backward/auto_ptr.h:12660:6: internal compiler
error: in vect_transform_stmt, at tree-vect-stmts.c:8692
0xd01186 vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
   
../../cray-gcc-7.2.0-201709081833.7aac99f36ce61/gcc/tree-vect-stmts.c:8692
0xd1a6ca vect_schedule_slp_instance
   
../../cray-gcc-7.2.0-201709081833.7aac99f36ce61/gcc/tree-vect-slp.c:3712
0xd1a44d vect_schedule_slp_instance
   
../../cray-gcc-7.2.0-201709081833.7aac99f36ce61/gcc/tree-vect-slp.c:3590
0xd1d845 vect_schedule_slp(vec_info*)
   
../../cray-gcc-7.2.0-201709081833.7aac99f36ce61/gcc/tree-vect-slp.c:3783
0xd05333 vect_transform_loop(_loop_vec_info*)
   
../../cray-gcc-7.2.0-201709081833.7aac99f36ce61/gcc/tree-vect-loop.c:7054
0xd2179b vectorize_loops()
   
../../cray-gcc-7.2.0-201709081833.7aac99f36ce61/gcc/tree-vectorizer.c:687
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
$

[Bug bootstrap/83439] [7 Regression] Bootstrap failure with --enable-checking=yes,rtl,extra

2017-12-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83439

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug bootstrap/83439] [7 Regression] Bootstrap failure with --enable-checking=yes,rtl,extra

2017-12-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83439

--- Comment #4 from Richard Biener  ---
Author: rguenth
Date: Fri Dec 15 20:45:36 2017
New Revision: 255704

URL: https://gcc.gnu.org/viewcvs?rev=255704=gcc=rev
Log:
2017-12-15  Richard Biener  

PR bootstrap/83439
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Adjust remaining gimple_set_modified to use the modified
variable instead.

Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-pre.c

[Bug target/83330] [7/8 Regression] generating unaligned store to stack for SSE register with -mno-push-args

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83330

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
(In reply to Zdenek Sojka from comment #0)
> Also, I do not understand why bar() is apparently inlined, when the function

bar isn't inlined.  Instead ipa-pure-const determines it is a const function
and because nothing really needs its return value, it is just not called at
all.

> has noinline,noclone attributes (noipa helps; -fno-ipa-pure-const helps
> too); but "noipa" implies just noinline,noclone,no_icf according to
> https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-
> Function-Attributes

No, it doesn't say anything like that.  It says it implies those attributes,
but is not a mere union of those 3 attributes, but disables many other IPA
optimizes between that function and the callers.
E.g. mere noinline, noclone, no_icf doesn't disable IPA VRP, or IPA bitwise
CCP, etc.

[Bug c++/80135] [6/7 Regression] ICE in output_constructor_regular_field, at varasm.c:4968

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80135

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[6/7/8 Regression] ICE in   |[6/7 Regression] ICE in
   |output_constructor_regular_ |output_constructor_regular_
   |field, at varasm.c:4968 |field, at varasm.c:4968

--- Comment #10 from Jakub Jelinek  ---
Fixed on the trunk.  Unsure about backports.

[Bug c++/81922] [6/7 Regression] ICE in output_constructor_regular_field, at varasm.c:5030

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81922

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[6/7/8 Regression] ICE in   |[6/7 Regression] ICE in
   |output_constructor_regular_ |output_constructor_regular_
   |field, at varasm.c:5030 |field, at varasm.c:5030

--- Comment #5 from Jakub Jelinek  ---
Fixed on the trunk.  Unsure about backports.

[Bug fortran/83416] [8 Regression] Invalid rejection of association of contiguous pointer to a target

2017-12-15 Thread anlauf at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83416

--- Comment #4 from Harald Anlauf  ---
(In reply to Thomas Koenig from comment #3)
> gfortran intentionally rejects such code.

I'm not convinced that this is correct.

The following code works with Cray, Intel and NAG in the way I expect it:

program gfcbug141d
  implicit none
  integer :: z(10)
  call foo (z)
  call foo (z(::2))
contains
  subroutine foo (x)
integer, target  :: x(:)
integer, pointer, contiguous :: a(:)
integer, pointer :: y(:)
if (is_contiguous (x)) then
   print *, "Dummy argument x is contiguous"
   a => x
else
   print *, "Dummy argument x is NOT contiguous"
   allocate (y(42))  ! Contiguous by 8.5.7 par. 2 items (5),(6)
   print *, "Temporary y is contiguous:", is_contiguous (y)
   a => y
end if
  end subroutine foo
end program gfcbug141d

They print:

 Dummy argument x is contiguous
 Dummy argument x is NOT contiguous
 Temporary y is contiguous: T

BTW: gfortran lacks is_contiguous.

I'm not reopening now, I'll leave that for you or others if you change your
mind.

[Bug c++/81922] [6/7/8 Regression] ICE in output_constructor_regular_field, at varasm.c:5030

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81922

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 20:20:00 2017
New Revision: 255703

URL: https://gcc.gnu.org/viewcvs?rev=255703=gcc=rev
Log:
PR c++/80135
PR c++/81922
* typeck2.c (digest_init_r): Change nested argument type from bool to
int.  Use code instead of TREE_CODE (type) where possible.  If
nested == 2, diagnose initialization of flexible array member with
STRING_CST.  Pass nested to process_init_constructor.  Formatting fix.
(digest_init, digest_init_flags): Adjust digest_init_r caller.
(massage_init_elt): Add nested argument.  Pass 2 instead of 1 to
digest_init_r's nested argument if nested is non-zero.
(process_init_constructor_array): Add nested argument.  If nested == 2,
diagnose initialization of flexible array member with non-empty
braced enclosed list.  Pass nested to massage_init_elt.
(process_init_constructor_record, process_init_constructor_union): Add
nested argument, pass it to massage_init_elt.
(process_init_constructor): Add nested argument, pass it to
process_init_constructor_{array,record,union}.
* init.c (find_field_init): Renamed to ...
(find_flexarray_init): ... this.  Return NULL_TREE if init is
error_mark_node.  Don't look through nested CONSTRUCTORs.
(warn_placement_new_too_small): Adjust caller.

* g++.dg/warn/Wplacement-new-size-1.C (fBx1): Initialize nested
flexible array member only with {}.  Add dg-warning.
(fBx2, fBx3): Remove.
* g++.dg/warn/Wplacement-new-size-2.C (fBx1): Initialize nested
flexible array member only with {}.  Add dg-warning.
(fBx2, fBx3): Remove.
* g++.dg/warn/Wplacement-new-size-6.C: New test.
* g++.dg/ext/flexary13.C (main): Remove test for initialization
of nested flexible array member with non-empty initializer.
* g++.dg/ext/flexary25.C: New test.
* g++.dg/ext/flexary26.C: New test.
* g++.dg/ext/flexary27.C: New test.
* g++.dg/parse/pr43765.C: Expect diagnostics about initialization
of nested flexible array member with non-empty initializer.  Expect
C++2A diagnostics about mixing of designated and non-designated
initializers.

Added:
trunk/gcc/testsuite/g++.dg/ext/flexary25.C
trunk/gcc/testsuite/g++.dg/ext/flexary26.C
trunk/gcc/testsuite/g++.dg/ext/flexary27.C
trunk/gcc/testsuite/g++.dg/warn/Wplacement-new-size-6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/cp/typeck2.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/ext/flexary13.C
trunk/gcc/testsuite/g++.dg/parse/pr43765.C
trunk/gcc/testsuite/g++.dg/warn/Wplacement-new-size-1.C
trunk/gcc/testsuite/g++.dg/warn/Wplacement-new-size-2.C

[Bug c++/80135] [6/7/8 Regression] ICE in output_constructor_regular_field, at varasm.c:4968

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80135

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 20:20:00 2017
New Revision: 255703

URL: https://gcc.gnu.org/viewcvs?rev=255703=gcc=rev
Log:
PR c++/80135
PR c++/81922
* typeck2.c (digest_init_r): Change nested argument type from bool to
int.  Use code instead of TREE_CODE (type) where possible.  If
nested == 2, diagnose initialization of flexible array member with
STRING_CST.  Pass nested to process_init_constructor.  Formatting fix.
(digest_init, digest_init_flags): Adjust digest_init_r caller.
(massage_init_elt): Add nested argument.  Pass 2 instead of 1 to
digest_init_r's nested argument if nested is non-zero.
(process_init_constructor_array): Add nested argument.  If nested == 2,
diagnose initialization of flexible array member with non-empty
braced enclosed list.  Pass nested to massage_init_elt.
(process_init_constructor_record, process_init_constructor_union): Add
nested argument, pass it to massage_init_elt.
(process_init_constructor): Add nested argument, pass it to
process_init_constructor_{array,record,union}.
* init.c (find_field_init): Renamed to ...
(find_flexarray_init): ... this.  Return NULL_TREE if init is
error_mark_node.  Don't look through nested CONSTRUCTORs.
(warn_placement_new_too_small): Adjust caller.

* g++.dg/warn/Wplacement-new-size-1.C (fBx1): Initialize nested
flexible array member only with {}.  Add dg-warning.
(fBx2, fBx3): Remove.
* g++.dg/warn/Wplacement-new-size-2.C (fBx1): Initialize nested
flexible array member only with {}.  Add dg-warning.
(fBx2, fBx3): Remove.
* g++.dg/warn/Wplacement-new-size-6.C: New test.
* g++.dg/ext/flexary13.C (main): Remove test for initialization
of nested flexible array member with non-empty initializer.
* g++.dg/ext/flexary25.C: New test.
* g++.dg/ext/flexary26.C: New test.
* g++.dg/ext/flexary27.C: New test.
* g++.dg/parse/pr43765.C: Expect diagnostics about initialization
of nested flexible array member with non-empty initializer.  Expect
C++2A diagnostics about mixing of designated and non-designated
initializers.

Added:
trunk/gcc/testsuite/g++.dg/ext/flexary25.C
trunk/gcc/testsuite/g++.dg/ext/flexary26.C
trunk/gcc/testsuite/g++.dg/ext/flexary27.C
trunk/gcc/testsuite/g++.dg/warn/Wplacement-new-size-6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/cp/typeck2.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/ext/flexary13.C
trunk/gcc/testsuite/g++.dg/parse/pr43765.C
trunk/gcc/testsuite/g++.dg/warn/Wplacement-new-size-1.C
trunk/gcc/testsuite/g++.dg/warn/Wplacement-new-size-2.C

[Bug c++/83217] Compiler segfault: structured binding by reference to a templated type via a pointer

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83217

--- Comment #3 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug c++/83217] Compiler segfault: structured binding by reference to a templated type via a pointer

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83217

--- Comment #2 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 19:41:45 2017
New Revision: 255702

URL: https://gcc.gnu.org/viewcvs?rev=255702=gcc=rev
Log:
PR c++/83217
* decl.c (cp_finish_decomp): If decl's type is REFERENCE_TYPE,
call complete_type (TREE_TYPE (type)).

* g++.dg/cpp1z/decomp33.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/decomp33.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog

[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))

2017-12-15 Thread costinc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

--- Comment #33 from costinc at gmail dot com ---
There are legitimate reasons to ignore results, even without additional
comments.
One use case I ran into is:

// ok() checks the same condition as the one returned by f().
while (ok()) {
switch (...) {
case 1:
(void)f(1);
case 2:
(void)f(2);
...
}
}

I don't think it's necessary to comment on every single call to f().

At some point people might start using if (f()){} on all function calls where
they don't use the result, because that works and casting to void doesn't
anymore because of this issue. The way to prevent that might be to start
warning on that too.

What if a static analysis tool decides to warn on if (f()){}? How do you please
both gcc and the tool? if ((void)f()){}? Thankfully this is a highly unlikely
scenario as it doesn't seem like other compilers/tools have their own unique
ideas here.

It seems the reason to warn even when using (void) is to implement a ticket
system. First, use (void). This will grant you a ticket to ignore results. At
some point we'll get angry and decide not to let you do this anymore because
you've abused it. Then, use if(f()){}. This will grant you a different ticket
so you can have a way to ignore results for a while longer. Then use the next
thing.

At least now there is [[nodiscard]] and casting to void is quite clearly
defined in the standard. But thanks to the present issue it's not quite the
portable way to ignore results (some libraries will use nodiscard, others will
use WUR).

[Bug bootstrap/83439] [7 Regression] Bootstrap failure with --enable-checking=yes,rtl,extra

2017-12-15 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83439

--- Comment #2 from rguenther at suse dot de  ---
On December 15, 2017 7:58:09 PM GMT+01:00, "jakub at gcc dot gnu.org"
 wrote  :
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83439
>
>--- Comment #1 from Jakub Jelinek  ---
>Bisected to r255682.  Guess I'll bootstrap my patchset with this change
>reverted.

Must have done sth obviously wrong with some manual part of the backport. I'll
fix up as soon as possible.

[Bug bootstrap/83439] [7 Regression] Bootstrap failure with --enable-checking=yes,rtl,extra

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83439

--- Comment #1 from Jakub Jelinek  ---
Bisected to r255682.  Guess I'll bootstrap my patchset with this change
reverted.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-15 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #81 from ktkachov at gcc dot gnu.org ---
(In reply to Alexandre Oliva from comment #80)
> A preprocessed testcase and command line would be welcome to try to debug
> the armv8 issue.

Sorry for the confusion. The armv8 bootstrap indeed fails with a clean trunk,
but with the patch from comment 63 applied it passes cleanly.

[Bug bootstrap/83439] [7 Regression] Bootstrap failure with --enable-checking=yes,rtl,extra

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83439

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-15
 CC||rguenth at gcc dot gnu.org
   Target Milestone|--- |7.3
 Ever confirmed|0   |1

[Bug bootstrap/83439] New: [7 Regression] Bootstrap failure with --enable-checking=yes,rtl,extra

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83439

Bug ID: 83439
   Summary: [7 Regression] Bootstrap failure with
--enable-checking=yes,rtl,extra
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

r255688 fails to bootstrap with
../configure --enable-languages=all,ada,obj-c++,lto,go,brig
--enable-checking=yes,rtl,extra
on both x86_64-linux and i686-linux, the error is:
../../gcc/ipa-icf.c: In static member function ‘static ipa_icf::sem_variable*
ipa_icf::sem_variable::parse(varpool_node*, bitmap_obstack*)’:
../../gcc/ipa-icf.c:3697:1: error: stmt (0x7fc209380ea0) marked modified after
optimization pass: 
 }
 ^
# .MEM_29 = VDEF <.MEM_27>
ipa_icf::sem_variable::init (_25);
../../gcc/ipa-icf.c:3697:1: internal compiler error: verify_ssa failed
0x15798c2 verify_ssa(bool, bool)
../../gcc/tree-ssa.c:1184
0x10f2420 execute_function_todo
../../gcc/passes.c:1973
0x10f1470 do_per_function
../../gcc/passes.c:1650
0x10f25ae execute_todo
../../gcc/passes.c:2016
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
Makefile:1099: recipe for target 'ipa-icf.o' failed
make[3]: *** [ipa-icf.o] Error 1

This is during FRE, so I suspect some of the recent tree-ssa-pre.c backports.

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

--- Comment #6 from Jakub Jelinek  ---
(In reply to Bernd Edlinger from comment #5)
> I think the best solution would be to use "V = void (*)(void);"
> 
> I quote from Joseph Myers e-mail from 10/10/2017 because I could not
> express it any better:
> 
> "Sometimes an interface needs to store an arbitrary function type [...]
> That's the sort of thing libffi 
> does - so it inherently needs to be able to take pointers to arbitrary 
> function types, which thus need to be converted to a generic function 
> type, and the de facto generic function pointer type in C is void (*) 
> (void).  (C11 6.11.6 says "The use of function declarators with empty 
> parentheses (not prototype-format parameter type declarators) is an 
> obsolescent feature.", so void (*) () is best avoided.)  Likewise 
> interfaces such as dlsym (which happens to return void * along with a 
> special case in POSIX requiring conversions between void * and function 
> pointers to work, but void (*) (void) is the natural type for such 
> interfaces to use).

For C sure, but we are talking here about C++.  void (*) () in C++ is different
from void (*) () in C.

[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))

2017-12-15 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

--- Comment #32 from Segher Boessenkool  ---
Yes, it does hurt.  Quite many people use casts to void automatically on
all function calls where they do not use the result.  They of course need
to be re-educated on that.  Casts to void do not portably suppress warnings,
either.  Finally, you can suppress the warning in much better ways (namely,
by actually using the result!  What a novel concept).

[Bug tree-optimization/83269] [6/7 Regression] Wrong constant folding

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83269

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P1  |P2
   Target Milestone|8.0 |6.5
Summary|[8 Regression] Wrong|[6/7 Regression] Wrong
   |constant folding|constant folding

--- Comment #8 from Jakub Jelinek  ---
Fixed for the trunk so far.

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

--- Comment #5 from Bernd Edlinger  ---
I think the best solution would be to use "V = void (*)(void);"

I quote from Joseph Myers e-mail from 10/10/2017 because I could not
express it any better:

"Sometimes an interface needs to store an arbitrary function type [...]
That's the sort of thing libffi 
does - so it inherently needs to be able to take pointers to arbitrary 
function types, which thus need to be converted to a generic function 
type, and the de facto generic function pointer type in C is void (*) 
(void).  (C11 6.11.6 says "The use of function declarators with empty 
parentheses (not prototype-format parameter type declarators) is an 
obsolescent feature.", so void (*) () is best avoided.)  Likewise 
interfaces such as dlsym (which happens to return void * along with a 
special case in POSIX requiring conversions between void * and function 
pointers to work, but void (*) (void) is the natural type for such 
interfaces to use).

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
Just using
using V = void (*)();
is enough to quiet the warning.

And, -Wbad-function-cast seems to be something different, at least from the
https://github.com/llvm-mirror/clang/blob/master/test/Sema/warn-bad-function-cast.c
testcase it seems it is warning about casting a return value of a function to
some other type, that is completely useless warning.  What is wrong on casting
a function return value with int type to float?  Or vice versa?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-15 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #80 from Alexandre Oliva  ---
A preprocessed testcase and command line would be welcome to try to debug the
armv8 issue.

[Bug tree-optimization/80631] [6/7 Regression] Compiling with -O3 -mavx2 gives wrong code

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80631

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 17:51:36 2017
New Revision: 255701

URL: https://gcc.gnu.org/viewcvs?rev=255701=gcc=rev
Log:
PR tree-optimization/80631
* gcc.target/i386/avx2-pr80631.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/avx2-pr80631.c
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/83429] Incorrect line number reported by -Wformat-truncation

2017-12-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83429

Martin Sebor  changed:

   What|Removed |Added

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

[Bug c++/83429] Incorrect line number reported by -Wformat-truncation

2017-12-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83429

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-15
 CC||msebor at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83369,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83336
 Ever confirmed|0   |1

--- Comment #3 from Martin Sebor  ---
Confirmed.  The whole sprintf pass is missing the %G directive in warning_at()
calls to print the inlining context.  With it added the warning for the test
case from comment #2 looks like this:

d.c: In function ‘void test(S*)’:
d.c:16:17: warning: ‘%s’ directive argument is null [-Wformat-truncation=]
 snprintf(s->out, sizeof(s->out), ".%s", s->str);
 ^~~

This should be easy to fix.  It's been in the back of my mind to do this but it
hasn't risen up to the top of the priority list.  With a bug reported for it I
have more of an incentive -- thanks :)

For reference, pr83369 and pr83336 point out similar or related problems with
the inlining context.

[Bug fortran/83436] Internal file cannot be accessed by UNFORMATTED data transfer when reading from /dev/urandom

2017-12-15 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83436

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-12-15
 Ever confirmed|0   |1

--- Comment #4 from Dominique d'Humieres  ---
WORKSFORME too!

[Bug fortran/83436] Internal file cannot be accessed by UNFORMATTED data transfer when reading from /dev/urandom

2017-12-15 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83436

--- Comment #3 from Jerry DeLisle  ---
Daan,

Works for me here. It could be that the compiler is trying to use a wrong
library version. Did you build gfortran yourself? What system are you running
on?

[Bug other/70268] add option -ffile-prefix-map to map one directory name (old) to another (new) in __FILE__, __BASE_FILE__and __builtin_FILE()

2017-12-15 Thread infinity0 at pwned dot gg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

--- Comment #14 from infinity0 at pwned dot gg ---
> it has a unified option (-ffile-prefix-map) [..]

Oh, nice. That might save me some work, then.

Could you bounce me the thread? Or failing that, tell me the Message-ID of one
of the messages, so I can reply to it.

> [..] that I believe does exactly what you want

Basically yes. However one minor extra thing my patch enables, is the remapping
of arbitrary file paths - whereas the current form can't remap paths with "="
in it. This is not a major issue, but I'd recommend that you change:

-  p = strchr (arg, '=');
+  p = strrchr (arg, '=');

This would be a bit more flexible.

> the environment variable is a bad idea.

The problem with doing this on the command-line is that the command-line
arguments then contain the build-path. Sometimes, builds like to save the
command-line arguments somewhere.

Using an environment variable avoids this issue. I agree envvars are dirty in
general, but in this case one would be *removing* information from what GCC is
already doing (taking in absolute-path information via the filesystem), as
opposed to *adding* information which is what other envvars do.

A more refined way to avoid this issue, is to allow $-based substitution, like
`-ffile-prefix-map=$BUILD_PATH=/usr/my/path` where BUILD_PATH is read from the
environment. Then we avoid adding $BUILD_PATH to the command-line args, but
/usr/my/path is still in there. Daniel Kahn Gillmor implemented this here [1]
though it was rejected in favour of a simpler approach for the bug mentioned
#69821 [2], however in retrospect this mechanism is actually very useful and
flexible. I found out recently that NetBSD still carries this patch to this
day, for reproducible builds. [3]

[1] https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01168.html
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69821
[3]
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/final.c?rev=1.2=text/x-cvsweb-markup

[Bug target/80210] ICE in in extract_insn, at recog.c:2311 on ppc64 for with __builtin_pow

2017-12-15 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80210

Peter Bergner  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

--- Comment #22 from Peter Bergner  ---
Back ports committed, so closing.

[Bug fortran/83436] Internal file cannot be accessed by UNFORMATTED data transfer when reading from /dev/urandom

2017-12-15 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83436

--- Comment #2 from Jerry DeLisle  ---
(In reply to Thomas Koenig from comment #1)
> I can not check this right. Jerry, van you take a look?

Looking

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

Segher Boessenkool  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #3 from Segher Boessenkool  ---
Casting between incompatible function types is explicitly allowed, both
in C and in C++.  And many programs actually do this.  Only actually
*calling* a function via the wrong type is UB.

You probably get too many warnings for -Wextra, and certainly for -Wall.
"-Wbad-*" is a terrible name in any case (there is nothing bad about such
a cast).

[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))

2017-12-15 Thread hansecke at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

--- Comment #31 from Hans Ecke  ---
I would like to point out that what everybody here proposes - make (void) work
properly with WUR - hurts no one. The other viewpoint has only given vague
theoretical reasons. Let me give you something concrete:

Sometimes my junior devs ask about wur-like functionality in C. My answer is
"would be nice to have, right?". That is because this attribute as gcc
implements it right now is useless. I'm not going to clutter my codebase with a
bunch of custom macros.

Please do one of the following:
* my preference: make the attribute work properly, in line with C++ and clang
* add a new attribute that has the behavior that 99.9% of the people actually
want

We've already lost 2 years. With the speed that new gcc releases make it to
production systems we could use proper wur in gcc in 2023.

[Bug fortran/83436] Internal file cannot be accessed by UNFORMATTED data transfer when reading from /dev/urandom

2017-12-15 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83436

Thomas Koenig  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu.org,
   ||tkoenig at gcc dot gnu.org

--- Comment #1 from Thomas Koenig  ---
I can not check this right. Jerry, van you take a look?

[Bug tree-optimization/83410] [8 regression] libgomp.graphite/force-parallel-4.c etc. FAIL

2017-12-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83410

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #7 from Jeffrey A. Law  ---
Fixed on the trunk.

[Bug tree-optimization/83410] [8 regression] libgomp.graphite/force-parallel-4.c etc. FAIL

2017-12-15 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83410

--- Comment #6 from Jeffrey A. Law  ---
Author: law
Date: Fri Dec 15 16:19:22 2017
New Revision: 255700

URL: https://gcc.gnu.org/viewcvs?rev=255700=gcc=rev
Log:
PR tree-optimization/83410
* tree-ssa-threadupdate.c (thread_block_1): Avoid certain jump
threads when parallelizing loops.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-threadupdate.c

[Bug other/70268] add option -ffile-prefix-map to map one directory name (old) to another (new) in __FILE__, __BASE_FILE__and __builtin_FILE()

2017-12-15 Thread boris at kolpackov dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

--- Comment #13 from Boris Kolpackov  ---
No, I was not aware, thanks for the pointer. I skimmed through it and I agree,
the environment variable is a bad idea. In fact, if you look at the patch that
I've proposed, it has a unified option (-ffile-prefix-map) that I believe does
exactly what you want (remap any references to matching paths in the result of
the compilation) while still allowing you to do more fine-grained mapping
(e.g., only for __FILE__). And it has a provision for future extensions.

[Bug other/70268] add option -ffile-prefix-map to map one directory name (old) to another (new) in __FILE__, __BASE_FILE__and __builtin_FILE()

2017-12-15 Thread infinity0 at pwned dot gg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

infinity0 at pwned dot gg changed:

   What|Removed |Added

 CC||infinity0 at pwned dot gg

--- Comment #12 from infinity0 at pwned dot gg ---
Are you aware of this patch?
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01315.html

If the overall motivation is to support reproducible builds, then you might be
interested in that, which is a unified mechanism that allows future extensions
to cover things *other* than __FILE__ and debug paths. (For example,
reproducible .o files which, I am told, contain STT_FILE entries that contain
the build path.)

The patch is not accepted yet; I had some review comments back in August and
I'm supposed to amend it to use a command-line flag instead of an environment
variable instead. I was going through my TODO backlog (non-GCC) since that
time, but I'll be finally working on this over the next week or so.

[Bug c++/59930] template friend declarations, namespaces, and explicit instantiations don't mix

2017-12-15 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59930

--- Comment #3 from Nathan Sidwell  ---
Author: nathan
Date: Fri Dec 15 15:04:59 2017
New Revision: 255698

URL: https://gcc.gnu.org/viewcvs?rev=255698=gcc=rev
Log:
[PR C++/59930] template friend classes & default args

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01055.html
PR c++/59930
* decl.c (xref_tag_1): Correct comments about template friends and
default args.
* friend.c (make_friend_class): Move comments concerning
self-friendliness to code dealing with such.
* pt.c (check_default_tmpl_args): Deal with template friend
classes too.
(push_template_decl_real): Check default args for non-function
template friends.

PR c++/59930
* g++.dg/cpp0x/temp_default4.C: Adjust diagnostic.
* g++.old-deja/g++.pt/friend23.C: Likewise.
* g++.old-deja/g++.pt/friend24.C: Delete.

Removed:
trunk/gcc/testsuite/g++.old-deja/g++.pt/friend24.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/friend.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/temp_default4.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/friend23.C

[Bug tree-optimization/83269] [8 Regression] Wrong constant folding

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83269

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 14:37:52 2017
New Revision: 255697

URL: https://gcc.gnu.org/viewcvs?rev=255697=gcc=rev
Log:
PR tree-optimization/83269
* fold-const.c (fold_binary_loc): Perform (-A) - B -> (-B) - A
subtraction in arg0's type if type is signed and arg0 is unsigned.
Formatting fix.

* gcc.c-torture/execute/pr83269.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr83269.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog

[Bug sanitizer/81281] [6/7 Regression] UBSAN: false positive, dropped promotion to long type.

2017-12-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81281

--- Comment #14 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 15 14:36:26 2017
New Revision: 255696

URL: https://gcc.gnu.org/viewcvs?rev=255696=gcc=rev
Log:
PR sanitizer/81281
* match.pd ((T)(P + A) - (T)P -> (T) A): Use @@0 instead of @0 and
convert? on @0 instead of convert.  Check type of @1, not @0.
((T)P - (T)(P + A) -> -(T) A): Use @@0 instead of @0 and
convert? on @0 instead of convert.  Check type of @1, not @0.
((T)(P + A) - (T)(P + B) -> (T)A - (T)B): Use @@0 instead of @0,
only optimize if either both @1 and @2 types are narrower
precision, or both are wider or equal precision, and in the former
case only if both have undefined overflow.

* gcc.dg/pr81281-3.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr81281-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/match.pd
trunk/gcc/testsuite/ChangeLog

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-12-15 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

--- Comment #40 from Martin Jambor  ---
(In reply to Sebastian Peryt from comment #39)
> I have tested it on SKX with SPEC2006INT and SPEC2017INT and don't see any
> regressions.

I should have written that the patch only affects znver1 tuning by
default, so if you try to see what the effects are on on another
platform or with some other tuning, you need to add

--param avoid-fma-max-bits=128

or perhaps 256 if that is the preferred vector length with your tuning
(or even 512 on the most modern Intel CPUs?) to the command line.  It
would be interesting to see what the effects of that is on modern
Intel CPUs both on SPEC and the matrix.c example.

Meanwhile, I have submitted the patch to mailing list:

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01053.html

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

--- Comment #2 from Markus Trippelsdorf  ---
I think casting to/from void* (*)() should always be silently accepted.
Or perhaps the warning should not be enabled even for -Wextra like clang's
-Wbad-function-cast. (BTW why didn't you use that name?)

[Bug tree-optimization/83438] New: [8 Regression] 435.gromacs miscompares

2017-12-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83438

Bug ID: 83438
   Summary: [8 Regression] 435.gromacs miscompares
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---
Target: x86_64-*-*

435.gromacs started to miscompare with -Ofast -flto -march=haswell.

*** Miscompare of gromacs.out, see
/home/gcc/spec/cpu2006/benchspec/CPU2006/435.gromacs/run/run_peak_ref_x86_64-linux./gromacs.out.mis
0002:  3.07684e+02
   3.12561e+02
 ^

last known good rev. is r255372 first known bad is r255400.

VRP and combine show up:

Updating SVN tree
Updating '.':
Ulibstdc++-v3/include/std/streambuf
Ulibstdc++-v3/include/std/bitset
Ulibstdc++-v3/include/bits/codecvt.h
Ulibstdc++-v3/include/bits/boost_concept_check.h
Ulibstdc++-v3/include/bits/locale_facets_nonio.tcc
Ulibstdc++-v3/include/bits/regex_compiler.tcc
Ulibstdc++-v3/ChangeLog
Ulibstdc++-v3/testsuite/24_iterators/operations/prev_neg.cc
Ulibstdc++-v3/config/io/basic_file_stdio.h
Ulibatomic/configure
Ulibatomic/Makefile.in
Ulibatomic/configure.ac
Ulibatomic/auto-config.h.in
Ulibatomic/configure.tgt
Ulibatomic/ChangeLog
Ulibatomic/libatomic_i.h
Alibatomic/config/linux/aarch64
Alibatomic/config/linux/aarch64/host-config.h
Ulibatomic/Makefile.am
Ugcc/graphite-isl-ast-to-gimple.c
Ugcc/DATESTAMP
Ugcc/lra.c
Ugcc/gimple-ssa-evrp.c
Ugcc/ChangeLog
Ugcc/testsuite/gcc.dg/pr82875.c
Agcc/testsuite/gcc.dg/graphite/pr83255.c
Agcc/testsuite/gcc.dg/graphite/pr83238.c
Agcc/testsuite/gcc.dg/builtin-unreachable-6a.c
Ugcc/testsuite/gcc.dg/builtin-unreachable-6.c
Ugcc/testsuite/gcc.dg/tree-ssa/20030922-2.c
Ugcc/testsuite/gcc.dg/tree-ssa/ssa-dom-branch-1.c
Ugcc/testsuite/ChangeLog
Ugcc/testsuite/g++.dg/cpp1z/constexpr-if12.C
Agcc/testsuite/g++.dg/cpp1z/constexpr-if13.C
Ugcc/cp/constexpr.c
Ugcc/cp/ChangeLog
Ugcc/cp/semantics.c
Ugcc/ipa-pure-const.c
Ugcc/tree-ssa-dom.c
Ugcc/go/gofrontend/parse.cc
Ugcc/go/gofrontend/MERGE
Agcc/ada/libgnat/s-osprim__rtems.adb
Ugcc/ada/libgnarl/s-osinte__rtems.ads
Ugcc/ada/ChangeLog
Ugcc/ada/gcc-interface/Makefile.in
Ugcc/graphite-scop-detection.c
Ugcc/combine.c
Ugcc/gimple-ssa-evrp-analyze.c
Ugcc/gimple-ssa-evrp-analyze.h
Ugcc/config/sparc/sparc.c
Ugcc/config/i386/athlon.md
Ugcc/config/i386/x86-tune-sched.c
Ugcc/config/i386/haswell.md
Ugcc/config/i386/i386.c
Ugcc/config/riscv/riscv.c
Ugcc/config/riscv/riscv.h
Ugcc/config/rs6000/rs6000.c
Updated to revision 255400.

[Bug tree-optimization/83438] [8 Regression] 435.gromacs miscompares

2017-12-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83438

Richard Biener  changed:

   What|Removed |Added

   Keywords||needs-bisection
   Target Milestone|--- |8.0

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

Bernd Edlinger  changed:

   What|Removed |Added

 CC||bernd.edlinger at hotmail dot 
de

--- Comment #1 from Bernd Edlinger  ---
This is on purpose, because the return value
is different: you cast a function returning int
to a function returning void*.

The warning can be suppressed by casting
thru (void(*)(void)) which is accepted as a
type-less function type:

using V = void *(*)();
struct A {
  A(V);
};
struct B : A {
  using F = int();
  B(F p1) : A((V) (void(*)(void)) p1) {}
};

[Bug sanitizer/83388] reference statement index not found error with -fsanitize=null

2017-12-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83388

Richard Biener  changed:

   What|Removed |Added

  Known to work||8.0
  Known to fail|8.0 |

--- Comment #14 from Richard Biener  ---
Fixed on trunk sofar.

[Bug sanitizer/83388] reference statement index not found error with -fsanitize=null

2017-12-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83388

--- Comment #13 from Richard Biener  ---
Author: rguenth
Date: Fri Dec 15 13:43:30 2017
New Revision: 255694

URL: https://gcc.gnu.org/viewcvs?rev=255694=gcc=rev
Log:
2017-12-15  Richard Biener  

PR lto/83388
* internal-fn.def (IFN_NOP): Add.
* internal-fn.c (expand_NOP): Do nothing.
* lto-streamer-in.c (input_function): Instead of removing
sanitizer calls replace them with IFN_NOP calls.

* gcc.dg/lto/pr83388_0.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/lto/pr83388_0.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/internal-fn.c
trunk/gcc/internal-fn.def
trunk/gcc/lto-streamer-in.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

2017-12-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437

Richard Biener  changed:

   What|Removed |Added

   Keywords||diagnostic
   Target Milestone|--- |8.0

[Bug middle-end/82365] stack locations are consolidated if noreturn function is on the path

2017-12-15 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365

--- Comment #11 from Arnd Bergmann  ---
More testing reveals that a handful of files in the kernel are affected by this
bug in the BUG() definition on architectures that do not use an inline assembly
statement to trap during an assertion, around half the supported architectures.
This kernel patch

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 963b755d19b0..23c6a2a6a3d6 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -52,6 +52,7 @@ struct bug_entry {
 #ifndef HAVE_ARCH_BUG
 #define BUG() do { \
printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__);
\
+   barrier(); \
panic("BUG!"); \
 } while (0)
 #endif

can work around the following set of overly large stack frames:

fs/ext4/inode.c:82:1: warning: the frame size of 1672 bytes is larger than 800
bytes [-Wframe-larger-than=]
fs/ext4/namei.c:434:1: warning: the frame size of 904 bytes is larger than 800
bytes [-Wframe-larger-than=]
fs/ext4/super.c:2279:1: warning: the frame size of 1160 bytes is larger than
800 bytes [-Wframe-larger-than=]
fs/ext4/xattr.c:146:1: warning: the frame size of 1168 bytes is larger than 800
bytes [-Wframe-larger-than=]
fs/f2fs/inode.c:152:1: warning: the frame size of 1424 bytes is larger than 800
bytes [-Wframe-larger-than=]
net/netfilter/ipvs/ip_vs_core.c:1195:1: warning: the frame size of 1068 bytes
is larger than 800 bytes [-Wframe-larger-than=]
net/netfilter/ipvs/ip_vs_core.c:395:1: warning: the frame size of 1084 bytes is
larger than 800 bytes [-Wframe-larger-than=]
net/netfilter/ipvs/ip_vs_ftp.c:298:1: warning: the frame size of 928 bytes is
larger than 800 bytes [-Wframe-larger-than=]
net/netfilter/ipvs/ip_vs_ftp.c:418:1: warning: the frame size of 908 bytes is
larger than 800 bytes [-Wframe-larger-than=]
net/netfilter/ipvs/ip_vs_lblcr.c:718:1: warning: the frame size of 960 bytes is
larger than 800 bytes [-Wframe-larger-than=]
drivers/net/xen-netback/netback.c:1500:1: warning: the frame size of 1088 bytes
is larger than 800 bytes [-Wframe-larger-than=]

and similar patches can be created for architectures not using the generic
implementation. For reference, the above was tested on all architectures that
are supported by mainline versions of both linux and gcc using an
'allmodconfig' build, and the same symptoms were visible on all architectures
using the generic BUG(). I only looked at files that had any functions with
frame sizes over 800 bytes (1000 bytes for 64-bit architectures), 89 files in
total out of 31841 source files that were built, down to 78 with my workaround.

In a single build, around 100 files had functions that get a (mostly minor)
reduction in frame size with my patch, in a few cases the frame sizes appear to
get slightly larger due to different inlining decisions, and in some other
cases including the ones listed above there is a drastic reduction in frame
size of factor two to five.

I have submitted a workaround for the kernel for the original case (involving
strncpy()) and plan to submit another workaround for BUG() now. However, I'd
still like to see this addressed in gcc as well, since that will cover those
instances in other code. I would hope that a simple workaround such as the
patch for PR81715 is possible. This seems to be a related issue with very
similar symptoms.

  1   2   >