[Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions

2020-08-20 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88473

Hongtao.liu  changed:

   What|Removed |Added

 CC||crazylht at gmail dot com

--- Comment #6 from Hongtao.liu  ---
Fixed in GCC11 by
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=388cb292a94f98a276548cd6ce01285cf36d17df

[Bug target/88798] AVX512BW code does not use bit-operations that work on mask registers

2020-08-20 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88798

Hongtao.liu  changed:

   What|Removed |Added

 CC||crazylht at gmail dot com

--- Comment #5 from Hongtao.liu  ---
Fixed in GCC11 by
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=388cb292a94f98a276548cd6ce01285cf36d17df

[Bug target/88808] bitwise operators on AVX512 masks fail to use the new mask instructions

2020-08-20 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88808

--- Comment #5 from Hongtao.liu  ---
Fixed in GCC11.

[Bug other/91085] fixincludes breaks

2020-08-20 Thread bkorb at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91085

--- Comment #12 from Bruce Korb  ---
I'll put it on my to-do list, but I might be participating in a fire evacuation
tonight or tomorrow and I haven't built GCC in several years now. I'm going to
guess that you have to not do the substitution when the line contains something
like:

#[ \t]*if[ \t]+__glibc_has

[Bug target/88808] bitwise operators on AVX512 masks fail to use the new mask instructions

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88808

--- Comment #4 from CVS Commits  ---
The master branch has been updated by hongtao Liu :

https://gcc.gnu.org/g:388cb292a94f98a276548cd6ce01285cf36d17df

commit r11-2796-g388cb292a94f98a276548cd6ce01285cf36d17df
Author: liuhongt 
Date:   Thu Aug 13 14:20:43 2020 +0800

Enable bitwise operation for type mask.

Enable operator or/xor/and/andn/not for mask register, kxnor is not
enabled since there's no corresponding instruction for general
registers.

gcc/
PR target/88808
* config/i386/i386.c (ix86_preferred_reload_class): Allow
QImode data go into mask registers.
* config/i386/i386.md: (*movhi_internal): Adjust constraints
for mask registers.
(*movqi_internal): Ditto.
(*anddi_1): Support mask register operations
(*and_1): Ditto.
(*andqi_1): Ditto.
(*andn_1): Ditto.
(*_1): Ditto.
(*qi_1): Ditto.
(*one_cmpl2_1): Ditto.
(*one_cmplsi2_1_zext): Ditto.
(*one_cmplqi2_1): Ditto.
(define_peephole2): Move constant 0/-1 directly into mask
registers.
* config/i386/predicates.md (mask_reg_operand): New predicate.
* config/i386/sse.md (define_split): Add post-reload splitters
that would convert "generic" patterns to mask patterns.
(*knotsi_1_zext): New define_insn.

gcc/testsuite/
* gcc.target/i386/bitwise_mask_op-1.c: New test.
* gcc.target/i386/bitwise_mask_op-2.c: New test.
* gcc.target/i386/bitwise_mask_op-3.c: New test.
* gcc.target/i386/avx512bw-pr88465.c: New testcase.
* gcc.target/i386/avx512bw-kunpckwd-1.c: Adjust testcase.
* gcc.target/i386/avx512bw-kunpckwd-3.c: Ditto.
* gcc.target/i386/avx512dq-kmovb-5.c: Ditto.
* gcc.target/i386/avx512f-kmovw-5.c: Ditto.
* gcc.target/i386/pr55342.c: Ditto.

[Bug target/71453] Spills to vector registers are sub-optimal.

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71453

--- Comment #6 from CVS Commits  ---
The master branch has been updated by hongtao Liu :

https://gcc.gnu.org/g:00cb3494cab397b5655ab42fd69310883c12137c

commit r11-2793-g00cb3494cab397b5655ab42fd69310883c12137c
Author: H.J. Lu 
Date:   Tue Sep 3 14:41:02 2019 -0700

x86: Add cost model for operation of mask registers.

gcc/

PR target/71453
* config/i386/i386.h (struct processor_costs): Add member
mask_to_integer, integer_to_mask, mask_load[3], mask_store[3],
mask_move.
* config/i386/x86-tune-costs.h (ix86_size_cost, i386_cost,
i386_cost, pentium_cost, lakemont_cost, pentiumpro_cost,
geode_cost, k6_cost, athlon_cost, k8_cost, amdfam10_cost,
bdver_cost, znver1_cost, znver2_cost, skylake_cost,
btver1_cost, btver2_cost, pentium4_cost, nocona_cost,
atom_cost, slm_cost, intel_cost, generic_cost, core_cost):
Initialize mask_load[3], mask_store[3], mask_move,
integer_to_mask, mask_to_integer for all target costs.
* config/i386/i386.c (ix86_register_move_cost): Using cost
model of mask registers.
(inline_memory_move_cost): Ditto.
(ix86_register_move_cost): Ditto.

[Bug tree-optimization/96730] New: ICE on x86_64-linux-gnu with `-O1` to `-O3` (in verify_sra_access_forest, at tree-sra.c:2352)

2020-08-20 Thread cnsun at uwaterloo dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96730

Bug ID: 96730
   Summary: ICE on x86_64-linux-gnu with `-O1` to `-O3` (in
verify_sra_access_forest, at tree-sra.c:2352)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -O1 t.c
during GIMPLE pass: esra
t.c: In function ‘d’:
t.c:10:1: internal compiler error: in verify_sra_access_forest, at
tree-sra.c:2352
   10 | int main() {}
  | ^~~
0x734000 verify_sra_access_forest(access*)
/tmp/tmp.uva1EAuUpA-gcc-builder/gcc/gcc/tree-sra.c:2352
0xf42be2 verify_all_sra_access_forests()
/tmp/tmp.uva1EAuUpA-gcc-builder/gcc/gcc/tree-sra.c:2403
0xf46bb4 analyze_all_variable_accesses
/tmp/tmp.uva1EAuUpA-gcc-builder/gcc/gcc/tree-sra.c:3450
0xf470e1 perform_intra_sra
/tmp/tmp.uva1EAuUpA-gcc-builder/gcc/gcc/tree-sra.c:4527
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ 
$ cat t.c
struct a {
  int b;
  int c;
} d() {
  struct a e[9];
  int f = 3362953455;
  e[f] = e[6];
  e[6].c = 1;
}
int main() {}
$ 
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.uva1EAuUpA-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200820 (experimental) [master revision
:01cb32abf:04e23a4051fb3c049f85b9e6e2fc58f937337aff] (GCC)

[Bug c/96729] New: hang on x86_64-linux-gnu with `-g -O3`

2020-08-20 Thread cnsun at uwaterloo dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96729

Bug ID: 96729
   Summary: hang on x86_64-linux-gnu with `-g -O3`
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ timeout -s 9 60 gcc-trunk -g -O3 t.c 
Killed
$ 
$ cat t.c
int a, b, d, e;
int c[9][4];
int main() {
  for (;;) {
long g;
if (e)
  continue;
d = 3;
for (; d < 22; d++) {
  a = 0;
  for (; a < 55; a = a + 6) {
b = 0;
for (; b < 9; b++) {
  g = 0;
  c[b][g] = 3;
}
  }
}
  }
}
$ 
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.uva1EAuUpA-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200820 (experimental) [master revision
:01cb32abf:04e23a4051fb3c049f85b9e6e2fc58f937337aff] (GCC) 
$ 
$ gcc-trunk -g -O2 t.c
$ 
$

[Bug analyzer/95152] ICE in get_or_create_mem_ref, at analyzer/region-model.cc:6938 since r10-5950-g757bf1dff5e8cee3

2020-08-20 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95152

David Malcolm  changed:

   What|Removed |Added

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

--- Comment #7 from David Malcolm  ---
As noted in the above commit, I removed the offending function in
r11-2694-g808f4dfeb3a95f50f15e71148e5c1067f90a126d and can no longer reproduce
this; marking it as fixed (for GCC 11).

[Bug analyzer/95152] ICE in get_or_create_mem_ref, at analyzer/region-model.cc:6938 since r10-5950-g757bf1dff5e8cee3

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95152

--- Comment #6 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:6b31b6b52612a6d4a7a84e71f6331464d68400d4

commit r11-2792-g6b31b6b52612a6d4a7a84e71f6331464d68400d4
Author: David Malcolm 
Date:   Thu Aug 20 17:50:14 2020 -0400

analyzer: add regression tests [PR95152]

PR analyzer/95152 reports various ICEs in
region_model::get_or_create_mem_ref.

I removed this function as part of the state rewrite in
r11-2694-g808f4dfeb3a95f50f15e71148e5c1067f90a126d.
I've verified that these two test cases reproduce the issue with 10.2
and don't ICE with trunk; adding them as regression tests.

gcc/testsuite/ChangeLog:
PR analyzer/95152
* gcc.dg/analyzer/pr95152-4.c: New test.
* gcc.dg/analyzer/pr95152-5.c: New test.

[Bug fortran/95352] ICE on select rank with assumed-size selector and lbound intrinsic

2020-08-20 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95352

--- Comment #5 from Steve Kargl  ---
On Thu, Aug 20, 2020 at 11:15:27PM +, jrfsousa at gmail dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95352
> 
> --- Comment #4 from José Rui Faustino de Sousa  ---
> I have tested the patch posted by Steve Kargl and it seems to do the trick.
> 
> Can I do anything to get this going?
> 

I don't use git, so have way to move forward.  If
you want to package the patch and add the testcase,
I would appreciate it.

[Bug d/96250] d: Field access in parentheses causes error: need 'this' for 'field' of type 'type'

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96250

--- Comment #4 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Iain Buclaw
:

https://gcc.gnu.org/g:bf465206b7012a9049821c68236093969d7767da

commit r10-8650-gbf465206b7012a9049821c68236093969d7767da
Author: Iain Buclaw 
Date:   Fri Aug 21 01:52:28 2020 +0200

d: Adjust backport of PR96250 for front-end implementation.

gcc/d/ChangeLog:

2020-08-21  Iain Buclaw  

PR d/96250
* dmd/expressionsem.c (ExpressionSemanticVisitor::visit(TypeExp)):
Fix cast from Expression to VarExp.

[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

2020-08-20 Thread marietto2008 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

--- Comment #31 from Marietto  ---
they don't reply to messages and they don't fix old bugs. And new users aren't
interested to use xen anymore. So,it's a waste of time.

[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

--- Comment #30 from Martin Sebor  ---
(In reply to Marietto from comment #28)
> I'm not a coder. can u explain to me carefully what should I do ? thanks.

Usually packages provide a mechanism to prevent compiler warnings from causing
errors (by avoiding -Werror).  I don't know how this one does it.  I'd try
adding WERROR=0 to the invocation of the command you are using to build it. 
The link is a diff from a Wiki edit, not a guide.  This also isn't the right
place to get help with third party software.   I'd talk to the Intel GVT-g
developers.

[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

2020-08-20 Thread marietto2008 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

--- Comment #29 from Marietto  ---
I get this error :

gcc -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes
-Wdeclaration-after-statement -Wno-unused-but-set-variable
-Wno-unused-local-typedefs -O2 -fomit-frame-pointer -nostdinc -fno-builtin
-fno-common -Werror -Wredundant-decls -Wno-pointer-arith -pipe -g -D__XEN__
-include /etc/xen/igvtg-xen/xen/include/xen/config.h
'-D__OBJECT_FILE__="trace.o"' -Wa,--strip-local-absolute -MMD -MF ./.trace.o.d
-I/etc/xen/igvtg-xen/xen/include
-I/etc/xen/igvtg-xen/xen/include/asm-x86/mach-generic
-I/etc/xen/igvtg-xen/xen/include/asm-x86/mach-default -DXEN_IMG_OFFSET=0x20
'-D__OBJECT_LABEL__=common$trace.o' -msoft-float -fno-stack-protector
-fno-exceptions -Wnested-externs -DHAVE_GAS_VMX -DHAVE_GAS_SSE4_2
-DHAVE_GAS_EPT -DHAVE_GAS_RDRAND -DHAVE_GAS_FSGSBASE -DHAVE_GAS_RDSEED
-U__OBJECT_LABEL__ -DHAVE_GAS_QUOTED_SYM '-D__OBJECT_LABEL__=common/trace.o'
-mno-red-zone -mno-sse -fpic -fno-asynchronous-unwind-tables
-DGCC_HAS_VISIBILITY_ATTRIBUTE -c trace.c -o trace.o
trace.c: In function ‘__trace_hypercall’:
trace.c:829:19: error: taking address of packed member of ‘struct ’ may result
in an unaligned pointer value [-Werror=address-of-packed-member]
829 | uint32_t *a = d.args;
| ^
cc1: all warnings being treated as errors

[Bug fortran/95352] ICE on select rank with assumed-size selector and lbound intrinsic

2020-08-20 Thread jrfsousa at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95352

--- Comment #4 from José Rui Faustino de Sousa  ---
I have tested the patch posted by Steve Kargl and it seems to do the trick.

Can I do anything to get this going?

Best regards,
José Rui

[Bug d/96250] d: Field access in parentheses causes error: need 'this' for 'field' of type 'type'

2020-08-20 Thread ibuclaw at gdcproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96250

Iain Buclaw  changed:

   What|Removed |Added

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

--- Comment #3 from Iain Buclaw  ---
Done.

[Bug d/96254] d: ICE using non-local variable: internal compiler error: Segmentation fault

2020-08-20 Thread ibuclaw at gdcproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96254

Iain Buclaw  changed:

   What|Removed |Added

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

--- Comment #3 from Iain Buclaw  ---
Done.

[Bug d/96250] d: Field access in parentheses causes error: need 'this' for 'field' of type 'type'

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96250

--- Comment #2 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Iain Buclaw
:

https://gcc.gnu.org/g:ee11a23b334d5fea08b80c2d87874388ed51d08e

commit r10-8649-gee11a23b334d5fea08b80c2d87874388ed51d08e
Author: Iain Buclaw 
Date:   Tue Jul 21 19:32:54 2020 +0200

d: Field access in parentheses causes error: need 'this' for 'field' of
type 'type'

1. Fixes an ICE in the front-end if a struct symbol were to appear twice
in the compilation unit.

2. Fixes a rejects-valid bug in the front-end where `(symbol)' was being
resolved as a `var' expression, instead of `this.var'.

gcc/d/ChangeLog:

PR d/96250
* dmd/dstruct.c (StructDeclaration::semantic): Error if
redefinition
of struct exists in compilation.
* dmd/expressionsem.c (ExpressionSemanticVisitor::visit(TypeExp)):
Rewrite resolved field variables as 'this.var' before semantic.
* dmd/parse.c (Parser::parseUnaryExp): Mark '(type) una_exp' as a
parenthesized expression.

gcc/testsuite/ChangeLog:

PR d/96250
* gdc.test/fail_compilation/fail17492.d: New test.
* gdc.test/compilable/b9490.d: New test.
* gdc.test/compilable/ice14739.d: New test.
* gdc.test/fail_compilation/ice21060.d: New test.
* gdc.test/fail_compilation/imports/ice21060a/package.d: New file.
* gdc.test/fail_compilation/imports/ice21060b/package.d: New file.
* gdc.test/fail_compilation/imports/ice21060c/package.d: New file.
* gdc.test/fail_compilation/imports/ice21060d/package.d: New file.
* gdc.test/runnable/b16278.d: New test.

[Bug d/96254] d: ICE using non-local variable: internal compiler error: Segmentation fault

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96254

--- Comment #2 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Iain Buclaw
:

https://gcc.gnu.org/g:a5d07caca15958980ae9cc4570a784f8b1a43403

commit r10-8647-ga5d07caca15958980ae9cc4570a784f8b1a43403
Author: Iain Buclaw 
Date:   Tue Jul 21 19:59:00 2020 +0200

d: Fix ICE using non-local variable: internal compiler error: Segmentation
fault

Moves no frame access error to own function, adding use of it for both
when get_framedecl() cannot find a path to the outer function frame, and
guarding get_decl_tree() from recursively calling itself.

gcc/d/ChangeLog:

PR d/96254
* d-codegen.cc (error_no_frame_access): New.
(get_frame_for_symbol): Use fdparent name in error message.
(get_framedecl): Replace call to assert with error.
* d-tree.h (error_no_frame_access): Declare.
* decl.cc (get_decl_tree): Detect recursion and error.

gcc/testsuite/ChangeLog:

PR d/96254
* gdc.dg/pr96254a.d: New test.
* gdc.dg/pr96254b.d: New test.

(cherry picked from commit 2b1c2a4bd9fb555dccde5d67d6da64547064e0e6)

[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

2020-08-20 Thread marietto2008 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

--- Comment #28 from Marietto  ---
I'm not a coder. can u explain to me carefully what should I do ? thanks.

Il giorno gio 20 ago 2020 alle ore 16:40 msebor at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> ha scritto:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919
>
> --- Comment #27 from Martin Sebor  ---
> The fix was applied to GCC 10 but not to GCC 9 or 8.  It will not be
> backported
> there.  It can be suppressed by introducing a named temporary copy of the
> pointer and using it as one other other argument to the function.
>
> void f (char *p)
> {
>   char *q = p;
>   sprintf (p, "%p", q);
> }
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.

[Bug analyzer/93994] ICE in get_or_create_mem_ref, at analyzer/region-model.cc:6599

2020-08-20 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93994

David Malcolm  changed:

   What|Removed |Added

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

--- Comment #2 from David Malcolm  ---
I can reproduce this with GCC 10.2, but not with trunk; the code in question
was heavily rewritten in r11-2694-g808f4dfeb3a95f50f15e71148e5c1067f90a126d,
which eliminated region_model::get_or_create_mem_ref.

I'm going to mark this as fixed.

[Bug libstdc++/77303] std::max_element not constexpr with -D_GLIBCXX_DEBUG

2020-08-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77303

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|DUPLICATE   |FIXED
   Target Milestone|--- |10.0

--- Comment #2 from Jonathan Wakely  ---
This specific issue was fixed for GCC 10.1 by r276260, although the general
problem described in PR 71960 isn't fixed.

[Bug analyzer/96723] [11 Regression] ICE: SIGSEGV: infinite recursion in ana::region::get_subregions_for_binding with -Og -fanalyzer

2020-08-20 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96723

David Malcolm  changed:

   What|Removed |Added

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

--- Comment #4 from David Malcolm  ---
Should be fixed by the above commit.

[Bug analyzer/96723] [11 Regression] ICE: SIGSEGV: infinite recursion in ana::region::get_subregions_for_binding with -Og -fanalyzer

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96723

--- Comment #3 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:00cb0f5840795698557731c6e549a5ce99573223

commit r11-2789-g00cb0f5840795698557731c6e549a5ce99573223
Author: David Malcolm 
Date:   Thu Aug 20 10:00:49 2020 -0400

analyzer: fix infinite recursion ICE on unions [PR96723]

Attempts to store sm-state into a union in C++ triggered an infinite
recursion when trying to generate a representative tree, due to
erroneously trying to use the dtor of the union as a field.

Fix it by filtering out non-FIELD_DECLs when walking TYPE_FIELDs
in region::get_subregions_for_binding.

gcc/analyzer/ChangeLog:
PR analyzer/96723
* region-model-manager.cc
(region_model_manager::get_field_region): Assert that field is a
FIELD_DECL.
* region.cc (region::get_subregions_for_binding): In
union-handling, filter the TYPE_FIELDS traversal to just
FIELD_DECLs.

gcc/testsuite/ChangeLog:
PR analyzer/96723
* g++.dg/analyzer/pr96723.C: New test.

[Bug c++/93529] Implement P1009R2, Array size deduction in new-expressions

2020-08-20 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93529

Marek Polacek  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #3 from Marek Polacek  ---
https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552336.html

[Bug bootstrap/96612] [11 Regression][submitted patch] Fails to bootstrap with older --build= than --host= compiler due to missing -std=c++11

2020-08-20 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96612

Tobias Burnus  changed:

   What|Removed |Added

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

--- Comment #2 from Tobias Burnus  ---
FIXED.

[Bug fortran/87711] ICE in gfc_trans_transfer, at fortran/trans-io.c:2676

2020-08-20 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87711

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org

--- Comment #3 from anlauf at gcc dot gnu.org ---
(In reply to kargl from comment #2)

For some reason the simplification of LEN_TRIM "forgets" that it is an
elemental function:

program p
  print *, len_trim( 'abc' )  ! OK
  print *, len_trim(['abc'])  ! OK
  print *, len_trim( 'abc' , kind=8)  ! OK
  print *, len_trim(['abc'], kind=8)  ! ICE
end

[Bug bootstrap/96612] [11 Regression][submitted patch] Fails to bootstrap with older --build= than --host= compiler due to missing -std=c++11

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96612

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Tobias Burnus :

https://gcc.gnu.org/g:7ffcf5d61174dda1f39a623e15f7e5d6b98bbafc

commit r11-2787-g7ffcf5d61174dda1f39a623e15f7e5d6b98bbafc
Author: Tobias Burnus 
Date:   Thu Aug 20 21:59:00 2020 +0200

configure: Also check C++11 (flags) for ${build} compiler not only for
${host}

config/ChangeLog:

PR bootstrap/96612
* ax_cxx_compile_stdcxx.m4: Add fourth argument to check also
the CXX_FOR_BUILD compiler.

ChangeLog:

PR bootstrap/96612
* configure.ac: Run AX_CXX_COMPILE_STDCXX also for ${build}
compiler,
if not the same as ${host}.
* configure: Regenerate.

[Bug libstdc++/71960] __glibcxx_assert and Debug Mode checks can't be used in constexpr functions

2020-08-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71960

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Status|NEW |ASSIGNED

[Bug fortran/96613] SIGFPE on min1() with -ffpe-trap=invalid switch

2020-08-20 Thread thomas.huxhorn at web dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96613

--- Comment #11 from Thomas Huxhorn  ---
I compiled the latest git GCC and rerun the program, no more problems. 
Thank you all :)

[Bug fortran/96728] New: Fatal Error: Reading module inquiry functions on assumed-rank

2020-08-20 Thread jrfsousa at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96728

Bug ID: 96728
   Summary: Fatal Error: Reading module inquiry functions on
assumed-rank
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jrfsousa at gmail dot com
  Target Milestone: ---

Created attachment 49091
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49091=edit
Fortran code demonstrating problems.

Hi all!

Fatal error reading modules containing inquiry functions on specification
expressions.

Tested on:

GNU Fortran (GCC) 9.3.1 20200819
GNU Fortran (GCC) 10.2.1 20200819
GNU Fortran (GCC) 11.0.0 20200807 (experimental)

Thank you very much.

Best regards,
José Rui

[Bug fortran/96727] New: ICE with character length specified using specification function on assumed-rank array

2020-08-20 Thread jrfsousa at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96727

Bug ID: 96727
   Summary: ICE with character length specified using
specification function on assumed-rank array
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jrfsousa at gmail dot com
  Target Milestone: ---

Created attachment 49090
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49090=edit
Fortran code demonstrating problems.

Hi all!

Using a specification function depending on an assumed-rank array argument to
set character length ICEs on:

GNU Fortran (GCC) 9.3.1 20200819
GNU Fortran (GCC) 10.2.1 20200819
GNU Fortran (GCC) 11.0.0 20200807 (experimental)

Thank you very much.

Best regards,
José Rui

[Bug analyzer/96666] [11 Regression] Analyzer creates too many regions for a particular program

2020-08-20 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9

Arseny Solokha  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #3 from Arseny Solokha  ---
.

*** This bug has been marked as a duplicate of bug 96723 ***

[Bug analyzer/96723] [11 Regression] ICE: SIGSEGV: infinite recursion in ana::region::get_subregions_for_binding with -Og -fanalyzer

2020-08-20 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96723

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #2 from Arseny Solokha  ---
*** Bug 9 has been marked as a duplicate of this bug. ***

[Bug fortran/96726] New: ICE with user defined specification function on assumed-rank array

2020-08-20 Thread jrfsousa at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96726

Bug ID: 96726
   Summary: ICE with user defined specification function on
assumed-rank array
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jrfsousa at gmail dot com
  Target Milestone: ---

Created attachment 49089
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49089=edit
Fortran code demonstrating problems.

Hi all!

An user defined specification function with an assumed-rank argument ICEs on:

GNU Fortran (GCC) 9.3.1 20200819
GNU Fortran (GCC) 10.2.1 20200819
GNU Fortran (GCC) 11.0.0 20200807 (experimental)

Thank you very much.

Best regards,
José Rui

[Bug middle-end/90367] Spurious warning array subscript is above array bounds

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90367

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #14 from Martin Sebor  ---
In light of comment #12, with current GCC not warning, and without a better
test case that does reproduce a bogus warning with current GCC, I'm going to
resolve this as WORKSFORSOME.  Please reopen if you have those details.

[Bug tree-optimization/56456] [meta-bug] bogus/missing -Warray-bounds

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
Bug 56456 depends on bug 90367, which changed state.

Bug 90367 Summary: Spurious warning array subscript is above array bounds
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90367

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME

[Bug fortran/96320] gfortran 8-10 shape mismatch in assumed-length dummy argument character array

2020-08-20 Thread damian at sourceryinstitute dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96320

--- Comment #24 from Damian Rouson  ---
This appears to be another example of an issue with a module procedure defined
in the same module as its interface body. In this case, the compiler doesn't
recognize a reference to the procedure:

± cat subroutine-call.f90 
module hole_interface
  type hole_t
  contains
procedure set_user_defined
  end type

  interface
module subroutine set_diameter (this)
  class(hole_t) this
end subroutine

module subroutine set_user_defined(this)
  class(hole_t) this
end subroutine
  end interface

contains
  module procedure set_user_defined
  end procedure

  module procedure set_diameter
call this%set_user_defined
  end procedure
end module

  use hole_interface
end

± gfortran subroutine-call.f90 
subroutine-call.f90:26:6:

   26 |   use hole_interface
  |  1
Error: ‘set_user_defined’ must be a module procedure or an external procedure
with an explicit interface at (1)

± gfortran --version
GNU Fortran (GCC) 11.0.0 20200804 (experimental)

[Bug fortran/96100] [9/10/11 Regression] ICE in gimplify_expr, at gimplify.c:14638

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96100

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Paul Thomas :

https://gcc.gnu.org/g:300ef2fcc10e98359d14654be23bbb84a5d141e1

commit r11-2785-g300ef2fcc10e98359d14654be23bbb84a5d141e1
Author: Paul Thomas 
Date:   Thu Aug 20 18:17:59 2020 +0100

This patch fixes PRs 96100 and 96101.

2020-08-20  Paul Thomas  

gcc/fortran
PR fortran/96100
PR fortran/96101
* trans-array.c (get_array_charlen): Tidy up the evaluation of
the string length for array constructors. Avoid trailing array
references. Ensure string lengths of deferred length components
are set. For parentheses operator apply string  length to both
the primary expression and the enclosed expression.

gcc/testsuite/
PR fortran/96100
PR fortran/96101
* gfortran.dg/char_length_23.f90: New test.

[Bug fortran/96101] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2398

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96101

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Paul Thomas :

https://gcc.gnu.org/g:300ef2fcc10e98359d14654be23bbb84a5d141e1

commit r11-2785-g300ef2fcc10e98359d14654be23bbb84a5d141e1
Author: Paul Thomas 
Date:   Thu Aug 20 18:17:59 2020 +0100

This patch fixes PRs 96100 and 96101.

2020-08-20  Paul Thomas  

gcc/fortran
PR fortran/96100
PR fortran/96101
* trans-array.c (get_array_charlen): Tidy up the evaluation of
the string length for array constructors. Avoid trailing array
references. Ensure string lengths of deferred length components
are set. For parentheses operator apply string  length to both
the primary expression and the enclosed expression.

gcc/testsuite/
PR fortran/96100
PR fortran/96101
* gfortran.dg/char_length_23.f90: New test.

[Bug tree-optimization/92539] [8/9/10/11 Regression] -Warray-bounds false positive with -O3 (loop unroll?)

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92539

Martin Sebor  changed:

   What|Removed |Added

Summary|[8/9/10/11 Regression]  |[8/9/10/11 Regression]
   |-Warray-bounds false|-Warray-bounds false
   |positive (loop unroll?) |positive with -O3 (loop
   ||unroll?)
  Known to fail||10.2.0, 11.0
   Last reconfirmed|2019-11-19 00:00:00 |2020-8-20

--- Comment #4 from Martin Sebor  ---
No change in GCC 10 or 11.

[Bug bootstrap/92828] array out of bounds access in libcpp/mkdeps.c

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92828

Martin Sebor  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|WAITING |RESOLVED

--- Comment #9 from Martin Sebor  ---
I see reports of successful z13 builds in gcc-testresults
(https://gcc.gnu.org/pipermail/gcc-testresults/2020-August/576248.html) so I'll
assume this has been fixed.

[Bug tree-optimization/56456] [meta-bug] bogus/missing -Warray-bounds

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
Bug 56456 depends on bug 92828, which changed state.

Bug 92828 Summary: array out of bounds access in libcpp/mkdeps.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92828

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug analyzer/96723] [11 Regression] ICE: SIGSEGV: infinite recursion in ana::region::get_subregions_for_binding with -Og -fanalyzer

2020-08-20 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96723

David Malcolm  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-08-20
 Ever confirmed|0   |1

--- Comment #1 from David Malcolm  ---
Thanks for filing this; am working on a fix.

[Bug middle-end/96725] warn for uses of global nonconstant unterminated char arrays where strings are required

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96725

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
   Severity|normal  |enhancement
 Blocks||88443


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
[Bug 88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

[Bug fortran/96711] Internal Compiler Error on NINT() Function

2020-08-20 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96711

--- Comment #13 from Steve Kargl  ---
On Thu, Aug 20, 2020 at 03:54:44PM +, bre08 at eggen dot co.uk wrote:
> 
> PS (and maybe I need to post this separately as a suggestion) - will
> there be a fast "octuple-precision floating point / integer" library
> (i.e. 256 bit) for C, C++ and Fortran, or is using something like
> GMP the only way forward ?

I'm not aware of any effort to offer an octuple-precision library.
If you need this level of accuracy, then you probably want to use
David Bailey's libraries or GMP/MPFR.

[Bug middle-end/96725] New: warn for uses of global nonconstant unterminated char arrays where strings are required

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96725

Bug ID: 96725
   Summary: warn for uses of global nonconstant unterminated char
arrays where strings are required
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Although using a non-constant array initialized to all non-nul characters where
a nul-terminated string is expected doesn't necessarily imply the initializer
is  what's used, it is an indication that it might be used, and so a warning
would be helpful, especially in code that doesn't make use of const.

$ cat z.c && gcc -O2 -S -Wall -Wrestrict -fdump-tree-strlen=/dev/stdout z.c
char a[4] = { 1, 2, 3, 4 };

int f (void) { return __builtin_strlen (a); }   // warn here

;; Function f (f, funcdef_no=0, decl_uid=1932, cgraph_uid=1, symbol_order=1)

;; 1 loops found
;;
;; Loop 0
;;  header 0, latch 1
;;  depth 0, outer -1
;;  nodes: 0 1 2
;; 2 succs { 1 }
f ()
{
  long unsigned int _1;
  int _3;

   [local count: 1073741824]:
  _1 = __builtin_strlen ();
  _3 = (int) _1;
  return _3;

}

[Bug middle-end/93665] missing warning on strncmp reading past unterminated array

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93665

Martin Sebor  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=94208

--- Comment #1 from Martin Sebor  ---
pr94208 is related but not quite the same because it involves enhancing the
strlen pass to detect the missing nul termination in the locally constructed
array, while this bug is about the missing detection for constant non-local
arrays.

[Bug tree-optimization/88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
Bug 88443 depends on bug 95667, which changed state.

Bug 95667 Summary: [11 Regression] unintended warning for memset writing across 
multiple members
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95667

   What|Removed |Added

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

[Bug middle-end/95667] [11 Regression] unintended warning for memset writing across multiple members

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95667

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Sebor  ---
Fixed in r11-1517.

[Bug fortran/96724] New: Bogus warnings with the repeat intrinsic and the flag -Wconversion-extra

2020-08-20 Thread jrfsousa at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96724

Bug ID: 96724
   Summary: Bogus warnings with the repeat intrinsic and the flag
-Wconversion-extra
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jrfsousa at gmail dot com
  Target Milestone: ---

Created attachment 49088
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49088=edit
Fortran code demonstrating problems.

Hi all!

Getting bogus warnings using the flag -Wconversion-extra of the type:

Warning: Conversion from INTEGER() to INTEGER(8)

AFAIK the repeat intrinsic is "generic" on integer kind and, IMHO, no warnings
should be generated.

Tested on:

GNU Fortran (GCC) 9.3.1 20200819
GNU Fortran (GCC) 10.2.1 20200819
GNU Fortran (GCC) 11.0.0 20200807 (experimental)

Thank you very much.

Best regards,
José Rui

[Bug fortran/93671] gfortran 8-10 ICE on intrinsic assignment to allocatable derived-type component of coarray

2020-08-20 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93671

Andre Vehreschild  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Andre Vehreschild  ---
No complaints so far, closing.

[Bug fortran/96711] Internal Compiler Error on NINT() Function

2020-08-20 Thread bre08 at eggen dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96711

--- Comment #12 from B Eggen  ---
Thanks for your explanations, and for reminding me of the excellent library etc
by David Bailey.  My original quest was to have a fast method to decide for
large integers quickly whether they are perfect squares. I prob need to do
something different to avoid the rounding pitfalls (:-)

PS (and maybe I need to post this separately as a suggestion) - will there be a
fast "octuple-precision floating point / integer" library (i.e. 256 bit) for C,
C++ and Fortran, or is using something like GMP the only way forward ?

BW, Bernd

[Bug fortran/94958] gcc/fortran/trans-array.c:9797: possible typo ?

2020-08-20 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94958

Andre Vehreschild  changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #6 from Andre Vehreschild  ---
Waiting a week for regression before closing as fixed.

[Bug fortran/94958] gcc/fortran/trans-array.c:9797: possible typo ?

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94958

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Andre Vehreschild :

https://gcc.gnu.org/g:05814dde7024a8fa05a735cafcda72b5eb5ec0c0

commit r11-2783-g05814dde7024a8fa05a735cafcda72b5eb5ec0c0
Author: Andre Vehreschild 
Date:   Thu Aug 20 17:50:16 2020 +0200

Fix obvious typo were errmsg_len was assigned to errmsg.

gcc/fortran/ChangeLog:

2020-08-20  Andre Vehreschild  

PR fortran/94958
* trans-array.c (gfc_bcast_alloc_comp): Use the correct variable.

[Bug testsuite/96718] 25_algorithms/pstl/feature_test-3.cc has excess error

2020-08-20 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96718

seurer at gcc dot gnu.org changed:

   What|Removed |Added

 Ever confirmed|0   |1
Summary|[11 regression] |25_algorithms/pstl/feature_
   |25_algorithms/pstl/feature_ |test-3.cc has excess error
   |test-3.cc has excess error  |
   |after r11-2743  |
 Resolution|INVALID |---
 Status|RESOLVED|REOPENED
   Last reconfirmed||2020-08-20

--- Comment #2 from seurer at gcc dot gnu.org ---
Ignore the above mention of a specific revision.  This always fails for me even
going back to r11-1 on one (just the one) of my power 8 LE test machines.  I
thought it might be something to do with the older binutils 2.27 version on
that system but I tested with binutils 2.35 and it does the same thing.

Anyone know what might be going on?

[Bug fortran/96711] Internal Compiler Error on NINT() Function

2020-08-20 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96711

--- Comment #11 from Steve Kargl  ---
On Thu, Aug 20, 2020 at 01:47:58PM +, bre08 at eggen dot co.uk wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96711
> 
> --- Comment #10 from B Eggen  ---
> I've been experimenting with the suggested work-around
> 
> m = anint(y)
> 
> This works for larger numbers, even in quad precision, however, it breaks down
> a long way before the integer*16 range is exhausted, consider the code below,
> which starts with 2^113 and tries to double it, minus 1.  The minus 1 is not
> taking effect:
> 

Of course, that is going to fail if you want an exact result.
REAL(16) is a floating point format, which has 113 digits of
precision.  This means that integers less than 2**113 are
exactly representable as REAL(16) floating point numbers.
When you double (2._16)**113 to (2._16)**114, that is a prefectly
fine REAL(16) floating point number.  Subtracting 1._16
from (2._16)**114 is a valid floating point operation.  Your
problem lies in that result is rounded, and 1._16 is less than
epsilon(1._16) in comparison to (2._16)**114.

> I guess at some point NINT() will be fixed, can anyone suggest a robust
> workaround that is valid until 2^127-1 ?

If you're trying to use floating point arithmetic in computations
and you need exact integral values up to 2**127-1, then there isn't
a REAL type that works.  

If you're looking for arbitrary precision arithmetic and you
want to use Fortran, I suggest that you google "David Bailey
arithmetic".

[Bug c/96683] Arm: MVE ACLE intrinsics vst1q_{s8|u8|s16|u16} is not supported by GCC.

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96683

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Joe Ramsay :

https://gcc.gnu.org/g:91d206adfe39ce063f6a5731b92a03c05e82e94a

commit r11-2782-g91d206adfe39ce063f6a5731b92a03c05e82e94a
Author: Joe Ramsay 
Date:   Wed Aug 19 12:34:06 2020 +

arm: Require MVE memory operand for destination of vst1q intrinsic

Previously, the machine description patterns for vst1q accepted a generic
memory
operand for the destination, which could lead to an unrecognised builtin
when
expanding vst1q* intrinsics. This change fixes the pattern to only accept
MVE
memory operands.

gcc/ChangeLog:

PR target/96683
* config/arm/mve.md (mve_vst1q_f): Require MVE memory operand
for
destination.
(mve_vst1q_): Likewise.

gcc/testsuite/ChangeLog:

PR target/96683
* gcc.target/arm/mve/intrinsics/vst1q_f16.c: New test.
* gcc.target/arm/mve/intrinsics/vst1q_s16.c: New test.
* gcc.target/arm/mve/intrinsics/vst1q_s8.c: New test.
* gcc.target/arm/mve/intrinsics/vst1q_u16.c: New test.
* gcc.target/arm/mve/intrinsics/vst1q_u8.c: New test.

[Bug c++/96720] ICE with* after include

2020-08-20 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96720

Marek Polacek  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Heh.  Confirmed:

q.C:1:29: warning: extra tokens at end of #include directive
1 | #include  *
  | ^
In file included from /usr/include/range/v3/view.hpp:25,
 from /usr/include/range/v3/all.hpp:25,
 from q.C:1:
/usr/include/range/v3/view/cartesian_product.hpp: In substitution of
‘template template template using
constify_if = meta::const_if_c [with T =
ranges::cartesian_product_view; bool IsConst_ = IsConst_; Views = {Views
...}]’:
/usr/include/range/v3/view/cartesian_product.hpp:154:47:   required from here
/usr/include/range/v3/view/cartesian_product.hpp:154:47: internal compiler
error: Segmentation fault
  154 | constify_if * view_;
  |   ^
0x15a1c0a crash_signal
/home/mpolacek/src/gcc/gcc/toplev.c:327
0x7f1fe406da6f ???
   
/usr/src/debug/glibc-2.31-48-g64246fccaf/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x95f237 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/mpolacek/src/gcc/gcc/tree.h:3417
0x9bca6c pop_nested_class()
/home/mpolacek/src/gcc/gcc/cp/class.c:8138
0xc4794b instantiate_template_1
/home/mpolacek/src/gcc/gcc/cp/pt.c:20826
0xc47f98 instantiate_template(tree_node*, tree_node*, int)
/home/mpolacek/src/gcc/gcc/cp/pt.c:20881
0xc48106 instantiate_alias_template
/home/mpolacek/src/gcc/gcc/cp/pt.c:20919
0xc29995 tsubst(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.c:15259
0xc0d5ad lookup_template_class_1
/home/mpolacek/src/gcc/gcc/cp/pt.c:9876
0xc0f688 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
/home/mpolacek/src/gcc/gcc/cp/pt.c:10159
0xc95b67 finish_template_type(tree_node*, tree_node*, int)
/home/mpolacek/src/gcc/gcc/cp/semantics.c:3446
0xb92d66 cp_parser_template_id
/home/mpolacek/src/gcc/gcc/cp/parser.c:16838
0xba0ad5 cp_parser_class_name
/home/mpolacek/src/gcc/gcc/cp/parser.c:23816
0xb7e345 cp_parser_qualifying_entity
/home/mpolacek/src/gcc/gcc/cp/parser.c:6844
0xb7d837 cp_parser_nested_name_specifier_opt
/home/mpolacek/src/gcc/gcc/cp/parser.c:6526
0xb7e0df cp_parser_nested_name_specifier
/home/mpolacek/src/gcc/gcc/cp/parser.c:6770
0xb98bdd cp_parser_using_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:19956
0xba3a5a cp_parser_member_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:25049
0xba3755 cp_parser_member_specification_opt
/home/mpolacek/src/gcc/gcc/cp/parser.c:24909
0xba152a cp_parser_class_specifier_1
/home/mpolacek/src/gcc/gcc/cp/parser.c:24006
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

2020-08-20 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

--- Comment #27 from Martin Sebor  ---
The fix was applied to GCC 10 but not to GCC 9 or 8.  It will not be backported
there.  It can be suppressed by introducing a named temporary copy of the
pointer and using it as one other other argument to the function.

void f (char *p)
{
  char *q = p;
  sprintf (p, "%p", q);
}

[Bug target/94531] gcc.target/arm/its.c fails for cortex-m3

2020-08-20 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94531

--- Comment #1 from Christophe Lyon  ---
(In reply to Christophe Lyon from comment #0)
> I've noticed that gcc.target/arm/its.c fails when targetting
> cortex-m3 or m33, but that's probably true with all cortex-m versions.
> 
Since I have extending testing to more CPUs, I've noticed that the test fails
for M3, M4 and M33, but passes for M7 (which has '1' as max_insns_skipped
tuning, while other v7m CPUs have '2').

If these are the expected results, that's not easy to describe in the testcase
:-)

[Bug tree-optimization/96722] [8/9/10/11 Regression] Clobbers on NULL since r8-1519

2020-08-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96722

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #2 from Martin Liška  ---
So the problematic transformation happens in einline:

BEFORE:

void foo(S*) (struct S * a)
{
   [0.00%] [count: INV]:
  if (a_2(D) != 0B)
goto ; [0.00%] [count: INV]
  else
goto ; [0.00%] [count: INV]

   [100.00%] [count: INV]:
  MEM[(struct  &)a_2(D)] ={v} {CLOBBER};

   [0.00%] [count: INV]:
  return;

}

after:

void foo(S*) (struct S * a)
{
   [0.00%] [count: INV]:
  if (a_2(D) != 0B)
goto ; [0.00%] [count: INV]
  else
goto ; [0.00%] [count: INV]

   [0.00%] [count: INV]:
  // predicted unlikely by early return (on trees) predictor.
  goto ; [0.00%] [count: INV]

   [100.00%] [count: INV]:
  MEM[(struct  &)a_2(D)] ={v} {CLOBBER};

   [0.00%] [count: INV]:
  return;

}

So as seen, the CFG is more complex as there's an extra GIMPLE_PREDICT.

main then inlines to:

Scope blocks after cleanups:

{ Scope block #0 

  { Scope block #7 ../pr96722.C:8 Originating from :  extern void S (struct S
*, int); 

  }

  { Scope block #8 ../pr96722.C:14 Originating from :  extern void S (struct S
*, int); 

  }

}
int main() ()
{
  int _5;

   [100.00%] [count: INV]:
  _5 = 0;
  return _5;

}

No longer having address taken: s
Scope blocks after cleanups:

{ Scope block #0 

  { Scope block #7 ../pr96722.C:8 Originating from :  extern void S (struct S
*, int); 

{ Scope block #8 Originating from :#0 

}

  }

  { Scope block #9 ../pr96722.C:14 Originating from :  extern void S (struct S
*, int); 

  }

}
int main() ()
{
  int _5;

   [100.00%] [count: INV]:
  MEM[(struct  &)0B] ={v} {CLOBBER};
  _5 = 0;
  return _5;

}

So I bet it's hidden in a CFG cleanup where it somehow removes the clobber?
I guess it was latent before my revision..

[Bug fortran/96711] Internal Compiler Error on NINT() Function

2020-08-20 Thread bre08 at eggen dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96711

--- Comment #10 from B Eggen  ---
I've been experimenting with the suggested work-around

m = anint(y)

This works for larger numbers, even in quad precision, however, it breaks down
a long way before the integer*16 range is exhausted, consider the code below,
which starts with 2^113 and tries to double it, minus 1.  The minus 1 is not
taking effect:

-> ./aint_working.e
 10384593717069655257060992658440192.00
 the next two lines should end in ...83

 20769187434139310514121985316880384.00
 20769187434139310514121985316880384.00

 20769187434139310514121985316880383

The source code is:


program aint_working

! does not work in quad precision (real*16)
! -> echo '2^113' | bc = 10384593717069655257060992658440192
! -> echo '2^114' | bc = 20769187434139310514121985316880384

  integer(kind=16) :: i, j, k

  integer, parameter :: idp=selected_real_kind(9,99)
  integer, parameter :: iqp=selected_real_kind(19,199)
  integer, parameter :: i16=selected_int_kind(38)

  real(kind=iqp) :: x, y, z

  x=10384593717069655257060992658440192.0q0  ! that is 2^113

  i=10384593717069655257060992658440192_16 ! as above, but integer
  k=20769187434139310514121985316880384_16 ! that is 2^114

  write(*,'(1x,f50.10)') x

  write(*,*) 'the next two lines should end in ...83'
  write(*,*)

  y=(x+x)-1.0q0
  write(*,'(1x,f50.10)') y

  z=(x-1.0q0)+x ! see if this helps
  write(*,'(1x,f50.10)') z

  j=(i+i)-1_16
  write(*,*)
  write(*,'(1x,i39)') j ! this is correct result (2^114-1)

  stop
end program aint_working


I guess at some point NINT() will be fixed, can anyone suggest a robust
workaround that is valid until 2^127-1 ?

Thanks, Bernd

[Bug c/96427] Missing align attribute for anchor section from local variables

2020-08-20 Thread zhongyunde at tom dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96427

--- Comment #6 from zhongyunde at tom dot com  ---
Created attachment 49087
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49087=edit
adjust the alignment according the attibute

If user don't specify the alignment, so we can do some optimization.
otherwise, we can obey it firstly, similiar to the patch attached?

[Bug middle-end/96680] [11 Regression][OpenMP][LTO] Declare variant + ICE in lto_fixup_prevailing_decls, at lto/lto-common.c:2595

2020-08-20 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96680

--- Comment #3 from Tobias Burnus  ---
Some regression hunting:
* Fails with r11-652-g79ea774f9a9d36d986152d93f9eae4a9ba36b37b
* Works on OG10 = devel/omp/gcc-10 and presumably GCC 10.

My bet is that the following commit causes the issue, but that trunk version
fails to build here: r11-382-g7a50e7087567cffb21e81fff566546b8a8dac270
(2020-05-14)
Namely:
  openmp: cgraph support for late declare variant resolution

[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

2020-08-20 Thread marietto2008 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

--- Comment #26 from Marietto  ---
I'm using ubuntu 20.04 and gcc 9.3

[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

2020-08-20 Thread marietto2008 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

Marietto  changed:

   What|Removed |Added

 CC||marietto2008 at gmail dot com

--- Comment #25 from Marietto  ---
Hello.

I'm trying to configure and compile GVT-g to enable the passthrough of the
integrated GPU that I have on my motherboard,the model "Intel Corporation UHD
Graphics 630 (Desktop 9 Series) (rev 02)". This is the tutorial that I'm
following :

https://lists.freedesktop.org/archives/intel-gvt-dev/2017-June/001238.html

I reached this point and then the compilation stopped for an error that it
seems to be the same as this.

root@ziomario-z390aoruspro:/etc/xen/gvt-linux# make
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  CHK include/generated/timeconst.h
  CHK include/generated/bounds.h
  CHK include/generated/asm-offsets.h
  CALLscripts/checksyscalls.sh
  DESCEND  objtool
  CC   /etc/xen/gvt-linux/tools/objtool/pager.o
  CC   /etc/xen/gvt-linux/tools/objtool/parse-options.o
  CC   /etc/xen/gvt-linux/tools/objtool/run-command.o
  CC   /etc/xen/gvt-linux/tools/objtool/sigchain.o
  CC   /etc/xen/gvt-linux/tools/objtool/subcmd-config.o
  LD   /etc/xen/gvt-linux/tools/objtool/libsubcmd-in.o
  AR   /etc/xen/gvt-linux/tools/objtool/libsubcmd.a
  GEN  /etc/xen/gvt-linux/tools/objtool/arch/x86/insn/inat-tables.c
  CC   /etc/xen/gvt-linux/tools/objtool/arch/x86/decode.o
  LD   /etc/xen/gvt-linux/tools/objtool/arch/x86/objtool-in.o
  CC   /etc/xen/gvt-linux/tools/objtool/builtin-check.o
  CC   /etc/xen/gvt-linux/tools/objtool/elf.o
  CC   /etc/xen/gvt-linux/tools/objtool/special.o
  CC   /etc/xen/gvt-linux/tools/objtool/objtool.o
  CC   /etc/xen/gvt-linux/tools/objtool/libstring.o
  CC   /etc/xen/gvt-linux/tools/objtool/str_error_r.o
../lib/str_error_r.c: In function ‘str_error_r’:
../lib/str_error_r.c:24:3: error: passing argument 1 to restrict-qualified
parameter aliases with argument 5 [-Werror=restrict]
   24 |   snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d",
errnum, buf, buflen, err);
  |   ^~~~
cc1: all warnings being treated as errors
mv: impossibile eseguire stat di
'/etc/xen/gvt-linux/tools/objtool/.str_error_r.o.tmp': File o directory non
esistente
make[3]: *** [Build:18: /etc/xen/gvt-linux/tools/objtool/str_error_r.o] Errore
1
make[2]: *** [Makefile:40: /etc/xen/gvt-linux/tools/objtool/objtool-in.o]
Errore 2
make[1]: *** [Makefile:61: objtool] Errore 2
make: *** [Makefile:1616: tools/objtool] Errore 2

I don't understand where is the patch ?

[Bug target/96479] AArch64: return SIMD register with -mgeneral-regs-only

2020-08-20 Thread qiaopeixin at huawei dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96479

--- Comment #6 from qiaopeixin at huawei dot com ---
Fix on
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a5a635fc4331b6d5f1a1e688e1153abd2ff194a5

[Bug target/96479] AArch64: return SIMD register with -mgeneral-regs-only

2020-08-20 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96479

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

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

--- Comment #5 from rsandifo at gcc dot gnu.org  
---
Now fixed.

[Bug tree-optimization/96633] missed optimization?

2020-08-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96633

--- Comment #3 from Martin Liška  ---
(In reply to Alexander Monakov from comment #2)
> Martin added me to CC so I assume he wants me to chime in.

Yes, you understood very well and thanks for the reply.

... 

> With that out of the way: striving to get efficient branchless code on this
> code is not very valuable in practice, because the caller is likely to
> perform a conditional branch on the result anyway. So making isWhitespace
> branchless simply moves the misprediction cost to the caller, making the
> overall code slower.

That's very important observation!

[Bug analyzer/96723] New: [11 Regression] ICE: SIGSEGV: infinite recursion in ana::region::get_subregions_for_binding with -Og -fanalyzer

2020-08-20 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96723

Bug ID: 96723
   Summary: [11 Regression] ICE: SIGSEGV: infinite recursion in
ana::region::get_subregions_for_binding with -Og
-fanalyzer
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 49086
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49086=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-g++ -Og -fanalyzer testcase.C 
x86_64-pc-linux-gnu-g++: internal compiler error: Segmentation fault signal
terminated program cc1plus
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

(gdb) bt
#0  0x7772a0b6 in _int_malloc () from /lib64/libc.so.6
#1  0x7772b9e4 in malloc () from /lib64/libc.so.6
#2  0x01fec7f5 in operator new(unsigned long) ()
#3  0x016c75e3 in ana::region_model_manager::get_field_region
(this=this@entry=0x7fffcc10, parent=parent@entry=0x10336890,
field=field@entry=0x775e8f00)
at /repo/gcc-trunk/gcc/analyzer/region-model.h:2352
#4  0x016ac2f6 in ana::region::get_subregions_for_binding
(this=0x10336890, mgr=0x7fffcc10, relative_bit_offset=...,
size_in_bits=..., type=0x774ad000, out=0x7fffbec8)
at /repo/gcc-trunk/gcc/analyzer/region.cc:314
#5  0x016ac33f in ana::region::get_subregions_for_binding
(this=0x10336510, mgr=0x7fffcc10, relative_bit_offset=...,
size_in_bits=..., type=0x774ad000, out=0x7fffbec8)
at /repo/gcc-trunk/gcc/analyzer/region.cc:315
#6  0x016ac33f in ana::region::get_subregions_for_binding
(this=0x10336190, mgr=0x7fffcc10, relative_bit_offset=...,
size_in_bits=..., type=0x774ad000, out=0x7fffbec8)
at /repo/gcc-trunk/gcc/analyzer/region.cc:315
#7  0x016ac33f in ana::region::get_subregions_for_binding
(this=0x10335e10, mgr=0x7fffcc10, relative_bit_offset=...,
size_in_bits=..., type=0x774ad000, out=0x7fffbec8)
...

$ x86_64-pc-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-g++
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r11-2779-20200820091258-g1763ec9b20c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-2779-20200820091258-g1763ec9b20c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20200820 (experimental) (GCC)

[Bug c++/96721] [11 Regression] pseudo-destructor calls on pointers since r11-2238

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96721

--- Comment #2 from Jakub Jelinek  ---
build_trivial_dtor_call has:
  if (INDIRECT_TYPE_P (TREE_TYPE (instance)))
{
  if (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (instance
goto no_clobber;
  instance = cp_build_fold_indirect_ref (instance);
}
so, either we adjust the caller such that for TYPE_PTR_P types it passes an
address of the instance rather than the instance itself, or we add an argument
(perhaps defaulted bool) to build_trivial_dtor_call that inhibits this behavior
for TYPE_PTR_P, or drop this if completely and adjust any caller that calls it
with a pointer or reference and expects it to destruct what it points to rather
than itself.

[Bug c++/96721] [11 Regression] pseudo-destructor calls on pointers since r11-2238

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96721

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/96721] [11 Regression] pseudo-destructor calls on pointers since r11-2238

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96721

--- Comment #1 from Jakub Jelinek  ---
More reduced testcase:

typedef int *T;

int
main ()
{
  T a = nullptr;
  a.~T ();
}

[Bug tree-optimization/96722] [8/9/10/11 Regression] Clobbers on NULL since r8-1519

2020-08-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96722

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #1 from Martin Liška  ---
Let me take a look.

[Bug c++/96717] -flifetime-dse=2 breaks webkit-gtk-2.28.4

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96717

--- Comment #4 from Jakub Jelinek  ---
I've moved the #c3 issues into PR96721 and PR96722 as they are separate.  And
either this bug turns a dup of the former, or not.

[Bug tree-optimization/96722] New: [8/9/10/11 Regression] Clobbers on NULL since r8-1519

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96722

Bug ID: 96722
   Summary: [8/9/10/11 Regression] Clobbers on NULL since r8-1519
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: needs-bisection, needs-reduction
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: jakub at gcc dot gnu.org, slyfox at gcc dot gnu.org,
unassigned at gcc dot gnu.org, webrown.cpp at gmail dot com
Depends on: 96717
Blocks: 96721
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #96717 +++

struct S { int s; ~S () {} };

void
foo (S *a)
{
  if (a)
return;
  a->~S ();
}

int
main ()
{
  S s;
  foo ();
}

is miscompiled, since r249450 aka
r8-1519-ge59a1c22fb249388e82b4fd004f33615abe36d2e at -O2.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96717
[Bug 96717] -flifetime-dse=2 breaks webkit-gtk-2.28.4
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96721
[Bug 96721] [11 Regression] pseudo-destructor calls on pointers since r11-2238

[Bug tree-optimization/96722] [8/9/10/11 Regression] Clobbers on NULL since r8-1519

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96722

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-08-20
   Target Milestone|--- |8.5
 CC||marxin at gcc dot gnu.org
   Keywords|needs-bisection,|
   |needs-reduction |
 Status|UNCONFIRMED |NEW

[Bug c++/96721] [11 Regression] pseudo-destructor calls on pointers since r11-2238

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96721

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-08-20
   Target Milestone|--- |11.0
 CC||jason at gcc dot gnu.org
 Status|UNCONFIRMED |NEW

[Bug c++/96721] New: [11 Regression] pseudo-destructor calls on pointers since r11-2238

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96721

Bug ID: 96721
   Summary: [11 Regression] pseudo-destructor calls on pointers
since r11-2238
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: needs-bisection, needs-reduction
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: jakub at gcc dot gnu.org, slyfox at gcc dot gnu.org,
unassigned at gcc dot gnu.org, webrown.cpp at gmail dot com
Depends on: 96717
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #96717 +++

In

typedef int *T;

void
foo (T a)
{
  if (a)
return;
  a.~T ();
}

int
main ()
{
  int p;
  foo ();
  foo (nullptr);
  return 0;
}

since r11-2238-ge443d8213864ac337c29092d4767224f280d2062 the pseudo-destructor
is emitted on what the pointer points to rather than on the pointer itself.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96717
[Bug 96717] -flifetime-dse=2 breaks webkit-gtk-2.28.4

[Bug c++/96717] -flifetime-dse=2 breaks webkit-gtk-2.28.4

2020-08-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96717

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-08-20
 CC||jakub at gcc dot gnu.org
 Status|UNCONFIRMED |NEW

--- Comment #3 from Jakub Jelinek  ---
The __builtin_trap is there because of:
if (isEmptyBucket(oldEntry)) {
do { if (!(std::addressof(oldEntry) != entry)) {
WTFReportAssertionFailure("WTF/wtf/HashTable.h", 1337, __PRETTY_FUNCTION__,
"std::
oldTable[i].~ValueType();
continue;
}
where the type of oldTable[i] and oldEntry is struct Thread *, isEmptyBucket is
== NULL check and invoking a pseudo-destructor.

Playing with this, I've come up with:
typedef int *T;

void
foo (T a)
{
  if (a)
return;
  a.~T ();
}

int
main ()
{
  int p;
  foo ();
  foo (nullptr);
  return 0;
}
testcase.

Starting with r11-2238-ge443d8213864ac337c29092d4767224f280d2062 we emit:
  if (a != 0B) goto ; else goto ;
  :
  // predicted unlikely by early return (on trees) predictor.
  return;
  :
  *a = {CLOBBER};
which doesn't look right to me, that is as if the (pseudo)destructor is run on
what the pointer points to (so if the testcase is changed to also have typedef
int V; and use a->~V (); rather than a.~T ();).
That is one thing, but I'd say in that case it ought to crash only if a is
NULL, because the pseudo destructor is invoked only in that case.
With that we have:
  if (a_2(D) != 0B)
goto ; [INV]
  else
goto ; [INV]

   :
  // predicted unlikely by early return (on trees) predictor.
  goto ; [INV]

   :
  MEM[(int *)0B] ={v} {CLOBBER};

   :
  return;
before cddce1, but we then "optimize" it into:
   :
  MEM[(int *)0B] ={v} {CLOBBER};
  return;

So, I'd say we have two bugs here, one is that the FE since r1-2238 mishandles
pseudo-destructors of pointer types, for that use the above testcase, and then
that we mishandle clobbers in DCE or so, for which the testcase is:
struct S { int s; ~S () {} };

void
foo (S *a)
{
  if (a)
return;
  a->~S ();
}

int
main ()
{
  S s;
  foo ();
  foo ((S *) 0);
}
which started to be really miscompiled with r249450, but had the questionable
unconditional
  MEM[(struct S *)0B] ={v} {CLOBBER};
as first stmt in main already since r197375.

So, in addition to fixing the C++ FE, I think we either shall declare that
clobbers never trap even if invoked with NULL pointers, then cddce can do the
optimization it does, but we shouldn't turn it into __builtin_trap later, or we
disable the optimization that happens during dce if the pointer in MEM_REF lhs
of a clobber is or might be NULL.

Now, whether fixing this (both or just one) fixes the above reported bug is
unclear.

[Bug c++/96717] -flifetime-dse=2 breaks webkit-gtk-2.28.4

2020-08-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96717

--- Comment #2 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #1)
> Created attachment 49085 [details]
> Preprocessed source for a.cc

This was prepared on x86_64-pc-linux-gnu.

Compile it with -O2 to see the ud2 insn in the .s output.

[Bug c++/96717] -flifetime-dse=2 breaks webkit-gtk-2.28.4

2020-08-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96717

--- Comment #1 from Jonathan Wakely  ---
Created attachment 49085
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49085=edit
Preprocessed source for a.cc

[Bug c++/96716] GCC reports "object is private" when it's accessed through proper accessor

2020-08-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96716

--- Comment #2 from Jonathan Wakely  ---
Slightly further reduced:

struct string_view
{
  constexpr string_view(const char* p) : p(p) { }
  const char* p;
};

struct Foo {
  constexpr string_view getfoo() const {
return {};
  }
private:
  const char foo = 'c';
};

inline constexpr Foo foo;

template 
struct Bar {
  static constexpr auto bar = foo.getfoo();
};

auto& baz = Bar::bar;

[Bug c++/96716] GCC reports "object is private" when it's accessed through proper accessor

2020-08-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96716

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-08-20
 Ever confirmed|0   |1
   Keywords||rejects-valid

--- Comment #1 from Jonathan Wakely  ---
Reduced:

struct string_view
{
  constexpr string_view(const char* p) : p(p) { }
  const char* p;
};

class Foo {
 public:
  constexpr string_view getfoo() const {
return {};
  }
 private:
  const char foo = 'c';
};

inline constexpr Foo foo;

template 
class Bar {
 public:
  static constexpr auto bar = foo.getfoo();
};

auto& baz = Bar::bar;


pr96716.C: In instantiation of 'constexpr const string_view Bar::bar':
pr96716.C:24:23:   required from here
pr96716.C:21:25: error: 'const char Foo::foo' is private within this context
   21 |   static constexpr auto bar = foo.getfoo();
  | ^~~
pr96716.C:13:14: note: declared private here
   13 |   const char foo = 'c';
  |  ^~~

[Bug fortran/96436] -std=f2003 -pedantic rejects valid f0.d edit descriptor

2020-08-20 Thread markeggleston at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96436

markeggleston at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #4 from markeggleston at gcc dot gnu.org ---
Committed to master.

[Bug c++/96719] non-standard handling of alias templates used as template template arguments

2020-08-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96719

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||ABI
 Ever confirmed|0   |1
 CC||jason at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-08-20

--- Comment #1 from Jonathan Wakely  ---
Yes I think this was an intentional decision. Possibly also related to CWG
1430.

[Bug fortran/96436] -std=f2003 -pedantic rejects valid f0.d edit descriptor

2020-08-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96436

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Mark Eggleston
:

https://gcc.gnu.org/g:c2a0fd7c8ff426cc40ec678efef85e4a376ea4b5

commit r11-2777-gc2a0fd7c8ff426cc40ec678efef85e4a376ea4b5
Author: Mark Eggleston 
Date:   Tue Aug 4 14:10:08 2020 +0100

Fortran  : rejected f0.d edit descriptor PR96436

Zero length f format descriptors are valid for Fortran 95 and
later.  For g format descriptors from Fortran 2008 and later.
Finally for D, E, EN and ES for Fortran 2018 and later.

2020-08-20  Mark Eggleston  

libgfortran/

PR fortran/96436
* io/format.c (parse_format_list):  Add new local variable
"standard" to hold the required standard to check. If the
format width is zero select standard depending on descriptor.
Call notification_std using the new standard variable.

2020-08-20  Mark Eggleston  

gcc/testsuite/

PR fortran/96436
* gfortran.dg/pr96436_1.f90: New test.
* gfortran.dg/pr96436_2.f90: New test.
* gfortran.dg/pr96436_3.f90: New test.
* gfortran.dg/pr96436_4.f90: New test.
* gfortran.dg/pr96436_5.f90: New test.
* gfortran.dg/pr96436_6.f90: New test.
* gfortran.dg/pr96436_7.f90: New test.
* gfortran.dg/pr96436_8.f90: New test.
* gfortran.dg/pr96436_9.f90
* gfortran.dg/pr96436_10.f90