[Bug fortran/102113] New: parsing error in assigned goto

2021-08-28 Thread wvermin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102113

Bug ID: 102113
   Summary: parsing error in assigned goto
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wvermin at gmail dot com
  Target Milestone: ---

This program produces an error:

   program p
  assign 10 to i
  goto i,(10,20 )
10continue
20continue
   end program

3 |   goto i,(10,20 )
  |1
Error: Syntax error in GOTO statement at (1)

The error disappears by changing '20 )' into '20)'

[Bug target/102089] MIPS: use N64 ABI by default if the triple end with -gnuabi64

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102089

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Xi Ruoyao :

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

commit r12-3196-g91f78b673b1f8d5bca52b1947206f71c2ffa4f60
Author: YunQiang Su 
Date:   Thu Aug 26 23:56:58 2021 -0400

MIPS: use N64 ABI by default if the triple end with -gnuabi64

gcc/ChangeLog:

PR target/102089
* config.gcc: MIPS: use N64 ABI by default if the triple end
  with -gnuabi64, which is used by Debian since 2013.

[Bug fortran/102114] New: label on END statement not recognized after CONTAINS

2021-08-28 Thread wvermin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102114

Bug ID: 102114
   Summary: label on END statement not recognized after CONTAINS
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wvermin at gmail dot com
  Target Milestone: ---

This program produces an error:

   program p
  goto 10
   contains
  subroutine s
  end subroutine s
10 end program

2 |   goto 10
  | 1
Error: Label 10 referenced at (1) is never defined

This program compiles ok:

   program p
  goto 10
10 end program

[Bug libstdc++/102074] include/bits/atomic_timed_wait.h:215: possible missing return ?

2021-08-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102074

--- Comment #1 from Jonathan Wakely  ---
N.B. I have a local work-in-progress patch for PR 50871 which would have
prevented this. I should finish that work.

[Bug preprocessor/31186] -I/usr/include not taken into account

2021-08-28 Thread vincent-gcc at vinc17 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31186

--- Comment #6 from Vincent Lefèvre  ---
OK, so I think there is a bug in the autotools, which use -I instead of
-isystem (unless this has changed).

[Bug libstdc++/99876] std::filesystem::absolute is inefficient

2021-08-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99876

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed|2021-04-01 00:00:00 |2021-8-28
   Target Milestone|--- |10.4
   Keywords||missed-optimization

[Bug libstdc++/99876] std::filesystem::absolute is inefficient

2021-08-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99876

Jonathan Wakely  changed:

   What|Removed |Added

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

[Bug libstdc++/99876] std::filesystem::absolute is inefficient

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99876

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:07b990ee23e0c7a92d362dbb25fd5d57d95eb8be

commit r12-3198-g07b990ee23e0c7a92d362dbb25fd5d57d95eb8be
Author: Jonathan Wakely 
Date:   Fri Aug 27 10:59:54 2021 +0100

libstdc++: Fix inefficiency in filesystem::absolute [PR99876]

When the path is already absolute, the call to current_path() is
wasteful, because operator/ will ignore the left operand anyway.

Signed-off-by: Jonathan Wakely 

libstdc++-v3/ChangeLog:

PR libstdc++/99876
* src/c++17/fs_ops.cc (fs::absolute): Call non-throwing form,
to avoid unnecessary current_path() call.

[Bug d/102094] d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430

2021-08-28 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102094

Iain Buclaw  changed:

   What|Removed |Added

Version|11.2.1  |12.0

--- Comment #1 from Iain Buclaw  ---
Only affects 12.0

[Bug target/40236] i386: request a single option to turn off all instructions which can cause #TS

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40236

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #6 from Andrew Pinski  ---
Dup of bug 70738 which was fixed for GCC 7.

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

[Bug target/70738] Add -mgeneral-regs-only option

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70738

Andrew Pinski  changed:

   What|Removed |Added

 CC||hpa at zytor dot com

--- Comment #8 from Andrew Pinski  ---
*** Bug 40236 has been marked as a duplicate of this bug. ***

[Bug target/51838] Inefficient add of 128 bit quantity represented as 64 bit tuple to 128 bit integer.

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51838

Andrew Pinski  changed:

   What|Removed |Added

  Component|middle-end  |target
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-28
 Ever confirmed|0   |1
   Keywords||missed-optimization

--- Comment #1 from Andrew Pinski  ---
We do get slightly better now:
xorl%eax, %eax
movq%rdi, %r8
xorl%edi, %edi
addq%rsi, %rax
adcq%rdi, %rdx
addq%rax, (%r8)
adcq%rdx, 8(%r8)
ret

Note on arch64 we do get good code:
ldp x3, x4, [x0]
addsx3, x3, x1
adc x4, x4, x2
stp x3, x4, [x0]
ret

[Bug fortran/102113] parsing error in assigned goto

2021-08-28 Thread kargl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102113

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 Ever confirmed|0   |1
   Last reconfirmed||2021-08-28
 CC||kargl at gcc dot gnu.org
 Status|UNCONFIRMED |NEW

--- Comment #1 from kargl at gcc dot gnu.org ---
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index b1105481099..d0cb5048787 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4079,7 +4079,7 @@ gfc_match_goto (void)
}
   while (gfc_match_char (',') == MATCH_YES);

-  if (gfc_match (")%t") != MATCH_YES)
+  if (gfc_match (" )%t") != MATCH_YES)
goto syntax;

   if (head == NULL)

[Bug fortran/87737] ICE tree check: expected ssa_name, have addr_expr in remap_gimple_op_r, at tree-inline.c:923

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87737

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Harald Anlauf :

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

commit r12-3201-gf9809ef57005409ee658294d6e8dad9ee8897e88
Author: Harald Anlauf 
Date:   Sat Aug 28 20:09:44 2021 +0200

Fortran - reject function entries with mismatched characteristics

gcc/fortran/ChangeLog:

PR fortran/87737
* resolve.c (resolve_entries): For functions of type CHARACTER
tighten the checks for matching characteristics.

gcc/testsuite/ChangeLog:

PR fortran/87737
* gfortran.dg/entry_24.f90: New test.

[Bug c++/46691] Null pointer in template deduction

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46691

--- Comment #4 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Harald Anlauf
:

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

commit r11-8936-gbe64e725111fdb9caa05374823b4423b8ab49dc7
Author: Paul Thomas 
Date:   Thu May 6 14:41:33 2021 +0100

Fortran: Assumed and explicit size class arrays [PR46691/99819].

2021-05-06  Paul Thomas  

gcc/fortran/ChangeLog

PR fortran/46691
PR fortran/99819
* class.c (gfc_build_class_symbol): Remove the error that
disables assumed size class arrays. Class array types that are
not deferred shape or assumed rank are given a unique name and
placed in the procedure namespace.
* trans-array.c (gfc_trans_g77_array): Obtain the data pointer
for class arrays.
(gfc_trans_dummy_array_bias): Suppress the runtime error for
extent violations in explicit shape class arrays because it
always fails.
* trans-expr.c (gfc_conv_procedure_call): Handle assumed size
class actual arguments passed to non-descriptor formal args by
using the data pointer, stored as the symbol's backend decl.

gcc/testsuite/ChangeLog

PR fortran/46691
PR fortran/99819
* gfortran.dg/class_dummy_6.f90: New test.
* gfortran.dg/class_dummy_7.f90: New test.

(cherry picked from commit a2c593009fef1564dbef2237ee71e9fd08f5361e)

[Bug fortran/99819] [9/10/11/12 Regression] ICE in gfc_defer_symbol_init, at fortran/trans-decl.c:841

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99819

--- Comment #6 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Harald Anlauf
:

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

commit r11-8936-gbe64e725111fdb9caa05374823b4423b8ab49dc7
Author: Paul Thomas 
Date:   Thu May 6 14:41:33 2021 +0100

Fortran: Assumed and explicit size class arrays [PR46691/99819].

2021-05-06  Paul Thomas  

gcc/fortran/ChangeLog

PR fortran/46691
PR fortran/99819
* class.c (gfc_build_class_symbol): Remove the error that
disables assumed size class arrays. Class array types that are
not deferred shape or assumed rank are given a unique name and
placed in the procedure namespace.
* trans-array.c (gfc_trans_g77_array): Obtain the data pointer
for class arrays.
(gfc_trans_dummy_array_bias): Suppress the runtime error for
extent violations in explicit shape class arrays because it
always fails.
* trans-expr.c (gfc_conv_procedure_call): Handle assumed size
class actual arguments passed to non-descriptor formal args by
using the data pointer, stored as the symbol's backend decl.

gcc/testsuite/ChangeLog

PR fortran/46691
PR fortran/99819
* gfortran.dg/class_dummy_6.f90: New test.
* gfortran.dg/class_dummy_7.f90: New test.

(cherry picked from commit a2c593009fef1564dbef2237ee71e9fd08f5361e)

[Bug fortran/99819] [9/10 Regression] ICE in gfc_defer_symbol_init, at fortran/trans-decl.c:841

2021-08-28 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99819

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

Summary|[9/10/11/12 Regression] ICE |[9/10 Regression] ICE in
   |in gfc_defer_symbol_init,   |gfc_defer_symbol_init, at
   |at fortran/trans-decl.c:841 |fortran/trans-decl.c:841

--- Comment #7 from anlauf at gcc dot gnu.org ---
Cherry-picked to 11-branch (with permit by Paul) after regtesting.

[Bug fortran/99125] [9/10/11/12 Regression] ICE: gimplification failed (gimplify.c:15068)

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99125

--- Comment #9 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:4cecfae4b57e052008e2febe25607d5e2cad5dbb

commit r10-10075-g4cecfae4b57e052008e2febe25607d5e2cad5dbb
Author: Paul Thomas 
Date:   Sat Mar 13 11:39:57 2021 +

Fortran: Fix for class defined operators [PR99125].

2021-03-13  Paul Thomas  

gcc/fortran
PR fortran/99125
* trans-array.c (gfc_conv_expr_descriptor): For deferred length
length components use the ss_info string length instead of
gfc_get_expr_charlen. Make sure that the deferred string length
is a variable before assigning to it. Otherwise use the expr.
* trans-expr.c (gfc_conv_string_length): Make sure that the
deferred string length is a variable before assigning to it.

gcc/testsuite/
PR fortran/99125
* gfortran.dg/alloc_deferred_comp_1.f90: New test.

(cherry picked from commit 7987beec679898cfa75839551d55ae5234a216bd)

[Bug fortran/99125] [9 Regression] ICE: gimplification failed (gimplify.c:15068)

2021-08-28 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99125

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

Summary|[9/10/11/12 Regression] |[9 Regression] ICE:
   |ICE: gimplification failed  |gimplification failed
   |(gimplify.c:15068)  |(gimplify.c:15068)

--- Comment #10 from anlauf at gcc dot gnu.org ---
Cherry-picked to 10-branch for Paul after regtesting.

[Bug tree-optimization/58095] SIMD code requiring auxiliary array for best optimization

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58095

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Keywords||missed-optimization

[Bug fortran/102114] label on END statement not recognized after CONTAINS

2021-08-28 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102114

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-08-28
   Priority|P3  |P4
   Keywords||rejects-valid

--- Comment #1 from anlauf at gcc dot gnu.org ---
We reject a valid program.

F2018: 11.2.1 Branch concepts

(1) ... A branch target statement is an ... end-program-stmt, ...

Not that I'd recommend the programming style in comment#0 ...

[Bug target/54344] illegal instructions generated with multiple "arch" function attributes

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54344

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
   Target Milestone|--- |4.9.0
  Known to fail||4.8.2, 4.8.5
  Known to work||4.9.0, 5.1.0, 7.1.0
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 4.9.0. There were many improvements to the target attribute for
GCC 4.9.0 and even some for later versions of the compiler.

[Bug target/60879] Wrong decision in decide_alg in i386.c

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60879

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Keywords||missed-optimization

--- Comment #3 from Andrew Pinski  ---
Fixed on the trunk:

movdqu  (%rdi), %xmm0
movups  %xmm0, (%rsi)
movq15(%rdi), %rax
movq%rax, 15(%rsi)
ret


While GCC 11 produced:

movdqu  (%rdi), %xmm0
movups  %xmm0, (%rsi)
movl16(%rdi), %eax
movl%eax, 16(%rsi)
movzwl  20(%rdi), %eax
movw%ax, 20(%rsi)
movzbl  22(%rdi), %eax
movb%al, 22(%rsi)
ret

[Bug c/53232] No warning for main() without a return statement with -std=c99

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53232

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-08-28
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #9 from Andrew Pinski  ---
Confirmed.

[Bug testsuite/63211] gcc.target/i386/avx2-*.c tests use broken type-punning

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63211

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-08-28
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Keywords||internal-improvement

--- Comment #3 from Andrew Pinski  ---
The testcases don't fail but the code is still broken as of today.

[Bug fortran/88486] ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.c:3401

2021-08-28 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88486

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 ---
Further reduced:

subroutine s(x)
  character(:), allocatable :: x(:)
  character(:), allocatable :: y(:)
  y = [x//'a']
end

[Bug middle-end/63772] Double included .h files in gcc/gtype-desc.c

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63772

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.0

--- Comment #2 from Andrew Pinski  ---
basic-block.h was removed at r6-2054
ggc.h was removed at r6-1445

So all fixed.

[Bug tree-optimization/64098] ICE isl_ctx.c:172: isl_ctx freed, but some objects still referenced

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64098

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Resolution|--- |FIXED
   Target Milestone|--- |6.0
 Status|UNCONFIRMED |RESOLVED

--- Comment #2 from Andrew Pinski  ---
Fixed by the removal of the support for this in r6-3014.

Also floop-unroll-and-jam has been rewritten not to need to use ISL at r8-5159
and r8-5204.

[Bug target/64376] [SH] Improve bswap support

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64376

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Severity|normal  |enhancement

[Bug bootstrap/65065] ICE with -O3 -floop-block on bootstrap

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65065

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Resolution|--- |FIXED
   Target Milestone|--- |6.0
 Status|UNCONFIRMED |RESOLVED

--- Comment #2 from Andrew Pinski  ---
Code was removed for GCC 6 at r6-3016 so closing as fixed.

[Bug fortran/93794] [9/10/11/12 Regression] ICE in gfc_conv_component_ref, at fortran/trans-expr.c:2497

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93794

--- Comment #11 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:803918dc6da9b7c88cc97635fc8a21bbd805a120

commit r10-10076-g803918dc6da9b7c88cc97635fc8a21bbd805a120
Author: Paul Thomas 
Date:   Fri Jan 8 10:15:22 2021 +

Fortran: Allow pointer deferred length associate selectors. [PR93794]

2021-01-05  Paul Thomas  

gcc/fortran
PR fortran/93794
* trans-expr.c (gfc_conv_component_ref): Remove the condition
that deferred character length components only be allocatable.

gcc/testsuite/
PR fortran/93794
* gfortran.dg/deferred_character_35.f90 : New test.

(cherry picked from commit 21c1a30fc73105af50c5e717cb99dc3becabf8fa)

[Bug fortran/93794] [9 Regression] ICE in gfc_conv_component_ref, at fortran/trans-expr.c:2497

2021-08-28 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93794

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

Summary|[9/10/11/12 Regression] ICE |[9 Regression] ICE in
   |in gfc_conv_component_ref,  |gfc_conv_component_ref, at
   |at  |fortran/trans-expr.c:2497
   |fortran/trans-expr.c:2497   |

--- Comment #12 from anlauf at gcc dot gnu.org ---
Cherry-picked to 10-branch for Paul after verifying that it fixes the issue.

[Bug tree-optimization/50918] Unoptimal code for vec-shift by scalar for integer (byte, short, long long) operands

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50918

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization

--- Comment #2 from Andrew Pinski  ---
Since GCC 9 for test_cst, the following is produced:
movdqa  a(%rip), %xmm0
psllw   $3, %xmm0
movaps  %xmm0, r(%rip)
ret


For test_var, GCC produces the following on the trunk:
test_var:
movdqa  a(%rip), %xmm0
movslq  %edi, %rax
movq%rax, %xmm2
pmovsxwd%xmm0, %xmm1
psrldq  $8, %xmm0
pmovsxwd%xmm0, %xmm0
pslld   %xmm2, %xmm1
pslld   %xmm2, %xmm0
movdqa  .LC0(%rip), %xmm2
pand%xmm2, %xmm1
pand%xmm0, %xmm2
movdqa  %xmm1, %xmm0
packusdw%xmm2, %xmm0
movaps  %xmm0, r(%rip)
ret

[Bug fortran/93925] Invalid memory reference upon call of a routine taking a procedure pointer as argument

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93925

--- Comment #9 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

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

commit r10-10077-gbf22e268b5c2a03216503254cfcb828016a7d998
Author: Paul Thomas 
Date:   Wed Jan 27 11:34:02 2021 +

Fortran: Fix ICE due to elemental procedure pointers [PR93924/5].

2021-01-27  Paul Thomas  

gcc/fortran
PR fortran/93924
PR fortran/93925
* trans-expr.c (gfc_conv_procedure_call): Suppress the call to
gfc_conv_intrinsic_to_class for unlimited polymorphic procedure
pointers.
(gfc_trans_assignment_1): Similarly suppress class assignment
for class valued procedure pointers.

gcc/testsuite/
PR fortran/93924
PR fortran/93925
* gfortran.dg/proc_ptr_52.f90 : New test.

(cherry picked from commit 4225af228b5d52e8d7593dea49584c91b4bc2e1f)

[Bug fortran/93924] [OOP] ICE with procedure pointer

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93924

--- Comment #13 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

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

commit r10-10077-gbf22e268b5c2a03216503254cfcb828016a7d998
Author: Paul Thomas 
Date:   Wed Jan 27 11:34:02 2021 +

Fortran: Fix ICE due to elemental procedure pointers [PR93924/5].

2021-01-27  Paul Thomas  

gcc/fortran
PR fortran/93924
PR fortran/93925
* trans-expr.c (gfc_conv_procedure_call): Suppress the call to
gfc_conv_intrinsic_to_class for unlimited polymorphic procedure
pointers.
(gfc_trans_assignment_1): Similarly suppress class assignment
for class valued procedure pointers.

gcc/testsuite/
PR fortran/93924
PR fortran/93925
* gfortran.dg/proc_ptr_52.f90 : New test.

(cherry picked from commit 4225af228b5d52e8d7593dea49584c91b4bc2e1f)

[Bug middle-end/63434] builtins.c has incorrect parameters for GEN_CALL_VALUE

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63434

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Keywords||ice-on-valid-code,
   ||internal-improvement
   Last reconfirmed||2021-08-28
 Status|UNCONFIRMED |NEW

--- Comment #4 from Andrew Pinski  ---
Still broken:
  emit_insn (targetm.gen_call_value (valreg,
 gen_rtx_MEM (FUNCTION_MODE, function),
 const0_rtx, NULL_RTX, const0_rtx));

[Bug fortran/93925] Invalid memory reference upon call of a routine taking a procedure pointer as argument

2021-08-28 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93925

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org

--- Comment #10 from anlauf at gcc dot gnu.org ---
Cherry-picked to 10-branch for Paul after verifying that this fixes the issue.

[Bug fortran/99818] [10/11/12 Regression] ICE in gfc_get_tree_for_caf_expr, at fortran/trans-expr.c:2186

2021-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99818

--- Comment #8 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:4a573574b17caf0391ee7f7febdaa82a9ff1094e

commit r10-10078-g4a573574b17caf0391ee7f7febdaa82a9ff1094e
Author: Paul Thomas 
Date:   Sat Apr 3 12:49:50 2021 +0100

Fortran: Fix ICE on wrong code [PR99818].

2021-04-03  Paul Thomas  

gcc/fortran/ChangeLog

PR fortran/99818
* interface.c (compare_parameter): The codimension attribute is
applied to the _data field of class formal arguments.

gcc/testsuite/ChangeLog

PR fortran/99818
* gfortran.dg/coarray_48.f90: New test.

(cherry picked from commit fc27115d6107f219e6f3dc610c99210005fe9dc5)

[Bug fortran/99818] [10/11/12 Regression] ICE in gfc_get_tree_for_caf_expr, at fortran/trans-expr.c:2186

2021-08-28 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99818

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||anlauf at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #9 from anlauf at gcc dot gnu.org ---
Cherry-picked to 10-branch for Paul after verifying that the issue is fixed.
Closing.

Thanks to Gerhard for the report, and to Paul for the fix!

[Bug c/101365] [9/10/11/12 Regression] ICE: in fold_convert_loc, at fold-const.c:243

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101365

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |9.5
   Severity|normal  |minor

[Bug c/101365] [9/10/11/12 Regression] ICE: in fold_convert_loc, at fold-const.c:243

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101365

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-28
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Confirmed.  Most likely started with r0-120559.

[Bug tree-optimization/102087] [12 Regression] ICE on valid code at -O3 on x86_64-linux-gnu: in determine_exit_conditions, at tree-ssa-loop-manip.c:1049 since r12-3136-g3673dcf6d6baeb67

2021-08-28 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102087

David Binderman  changed:

   What|Removed |Added

 CC||dcb314 at hotmail dot com

--- Comment #8 from David Binderman  ---
I see this problem also, with this reduced C code:

char **Gif_ClipImage_gfi_0;
int Gif_ClipImage_y, Gif_ClipImage_shift;
void Gif_ClipImage(void) {
  for (; Gif_ClipImage_y >= Gif_ClipImage_shift; Gif_ClipImage_y++)
Gif_ClipImage_gfi_0[Gif_ClipImage_shift] =
Gif_ClipImage_gfi_0[Gif_ClipImage_y];
}

Flag -O3 -march=bdver2 required.

[Bug c/101365] [9/10/11/12 Regression] ICE: in fold_convert_loc, at fold-const.c:243

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101365

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #2 from Andrew Pinski  ---
dup of bug 79412

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

[Bug c/79412] [9/10/11/12 Regression] ICE in fold_convert_loc, at fold-const.c:2239

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79412

--- Comment #15 from Andrew Pinski  ---
*** Bug 101365 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/102087] [12 Regression] ICE on valid code at -O3 on x86_64-linux-gnu: in determine_exit_conditions, at tree-ssa-loop-manip.c:1049 since r12-3136-g3673dcf6d6baeb67

2021-08-28 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102087

--- Comment #9 from David Binderman  ---
This second source code generates a similar but different error message:

void dnslabel_vector_dnslabel_to_dnsname_namestack(int bottom) {
  char **name;
  int top;
  while (bottom <= top) {
char label = *name++;
memcpy(0, label, label);
bottom--;
  }
}

internal compiler error: in determine_exit_conditions, at
tree-ssa-loop-manip.c:1045

Some four lines different place in the compiler source code to the original.

[Bug c/93572] [9/10/11/12 Regression] internal compiler error: q from h referenced in main

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93572

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #6 from Andrew Pinski  ---
Dup of bug 98621.

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

[Bug c/98621] [9/10/11/12 Regression] ICE: x from g referenced in f

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98621

Andrew Pinski  changed:

   What|Removed |Added

 CC||changochen1 at gmail dot com

--- Comment #2 from Andrew Pinski  ---
*** Bug 93572 has been marked as a duplicate of this bug. ***

[Bug middle-end/101455] missing -Wstringop-overflow on buffer overflow by a complex number

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101455

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-08-28
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
Confirmed, that is we should get a warning at -O0 -W -Wall.

Note the gimple is different between -O2 and -O0.

-O0 gimple:
  p_4 = __builtin_malloc (8);
  _1 = COMPLEX_EXPR ;
  *p_4 = _1;

[Bug libstdc++/101439] std::atomic::load() crashes - possible fix with mutable

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101439

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Dup of bug 95722.

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

[Bug target/95722] libatomic crashes on __atomic_load of const object

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95722

Andrew Pinski  changed:

   What|Removed |Added

 CC||doodspav at gmail dot com

--- Comment #4 from Andrew Pinski  ---
*** Bug 101439 has been marked as a duplicate of this bug. ***

[Bug c++/95806] Result of call with reference argument to newed object is cached during constant evaluation

2021-08-28 Thread wjwray at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95806

Will Wray  changed:

   What|Removed |Added

 CC||wjwray at gmail dot com

--- Comment #1 from Will Wray  ---
Works on gcc 11

[Bug libstdc++/101439] std::atomic::load() crashes - possible fix with mutable

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101439

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|DUPLICATE   |---
 Status|RESOLVED|NEW
   Last reconfirmed||2021-08-28
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
LLVM's libc++ does:
template ::value && !is_same<_Tp,
bool>::value>
struct __atomic_base
{
mutable __cxx_atomic_impl<_Tp> __a_;

...

template 
struct __atomic_base<_Tp, true>
: public __atomic_base<_Tp, false>

[Bug c++/95806] Result of call with reference argument to newed object is cached during constant evaluation

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95806

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Andrew Pinski  ---
Dup of bug 99859.

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

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859

Andrew Pinski  changed:

   What|Removed |Added

 CC||johelegp at gmail dot com

--- Comment #22 from Andrew Pinski  ---
*** Bug 95806 has been marked as a duplicate of this bug. ***

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859

Andrew Pinski  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
   Target Milestone|--- |10.4
 Resolution|--- |FIXED

--- Comment #23 from Andrew Pinski  ---
Fixed.

[Bug c++/80061] error on constexpr function with an unevaluated throw

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80061

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=86678
   Target Milestone|--- |9.0

--- Comment #8 from Andrew Pinski  ---
Fixed.

[Bug c++/82572] throw on line by itself in constexpr function aborts compile even if never reached

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82572
Bug 82572 depends on bug 80061, which changed state.

Bug 80061 Summary: error on constexpr function with an unevaluated throw
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80061

   What|Removed |Added

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

[Bug rtl-optimization/102115] New: symbol address eliminated by the xtensa size optimization

2021-08-28 Thread me at jhdtl dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102115

Bug ID: 102115
   Summary: symbol address eliminated by the xtensa size
optimization
   Product: gcc
   Version: 12.0
   URL: https://github.com/earlephilhower/newlib-xtensa/issues
/19#issuecomment-903203750
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: me at jhdtl dot ru
  Target Milestone: ---
  Host: x86_64-w64-mingw32
Target: xtensa-lx106-elf
 Build: x86_64-linux-gnu

Created attachment 51370
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51370&action=edit
Missing symbol example

.\x86_64-w64-mingw32.xtensa-lx106-elf-1757bed.210826\xtensa-lx106-elf\bin\xtensa-lx106-elf-gcc.exe
-v
Using built-in specs.
COLLECT_GCC=C:\Users\maxim\Documents\gist\a433474aa40ab0f6433f9240455fd624\x86_64-w64-mingw32.xtensa-lx106-elf-1757bed.210826\xtensa-lx106-elf\bin\xtensa-lx106-elf-gcc.exe
COLLECT_LTO_WRAPPER=c:/users/maxim/documents/gist/a433474aa40ab0f6433f9240455fd624/x86_64-w64-mingw32.xtensa-lx106-elf-1757bed.210826/xtensa-lx106-elf/bin/../libexec/gcc/xtensa-lx106-elf/12.0.0/lto-wrapper.exe
Target: xtensa-lx106-elf
Configured with: /home/jhdtl/dev/esp-quick-toolchain/repo/gcc-gnu/configure
--prefix=/home/jhdtl/dev/esp-quick-toolchain/xtensa-lx106-elf.win64
--build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --target=xtensa-lx106-elf
--disable-shared --with-newlib --enable-threads=no --disable-__cxa_atexit
--disable-libgomp --disable-libmudflap --disable-nls --disable-multilib
--disable-bootstrap --enable-languages=c,c++ --enable-lto --enable-static=yes
--disable-libstdcxx-verbose
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210825 (experimental) (GCC)


After the 64a54505ec8249178b9767d1420354f8eb55de50, using -Os on
x86_64-w64-mingw32 *may* result in missing function symbol in the example
test.ii attached if the symbol's address can be compressed into small number
accepted by the movi + slli.

>From the URL, adding the suggested fprintf to the 'xtensa_emit_move_sequence'
and running with the following command:
$ xtensa-lx106-elf-g++.exe -Os -save-temps -mlongcalls -mtext-section-literals
-falign-functions=4 -ffunction-sections -fdata-sections -Wall
-Werror=return-type -free -fipa-pta -fno-rtti -std=gnu++17 -S -o test.S
test.cpp

Prints when the optimization happens:
[xtensa_emit_move_sequence @ function()] '513540096[0x1e9c]' =>
'1959[0x7a7] << 18'
[xtensa_emit_move_sequence @ function()] '513540096[0x1e9c]' =>
'1959[0x7a7] << 18'
[xtensa_emit_move_sequence @ function()] '513540096[0x1e9c]' =>
'1959[0x7a7] << 18'

Which will not be the expected function address at runtime, and will also
remove the symbol from the resulting object:
test.S:_Z8functionv:   
   
   movia5, 0x7a7   
   
   sllia5, a5, 18  
   
   l32ra4, .LC209  
   
   l32ra2,
.LC426 
   
mov.n   a3, a5 
   
s32i.n  a5, sp, 20 
   
call0   _Z8three132PFvPFvPFvvEES0_ES2_S0_

[Bug c++/81042] Too many constexpr iterations on unreachable loop.

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81042

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
Dup of bug 86767.

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

[Bug c++/86767] [6/7 Regression] continue statements in constexpr functions causes unbounded looping

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86767

Andrew Pinski  changed:

   What|Removed |Added

 CC||kevincox at kevincox dot ca

--- Comment #8 from Andrew Pinski  ---
*** Bug 81042 has been marked as a duplicate of this bug. ***

[Bug c++/89785] Incorrect "not a constant expression" error with switch statement that returns

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89785

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |9.0

[Bug c++/98672] constexpr function - for loop with return statement doesn't get recognized as constexpr subexpression

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98672

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||10.3.0, 11.1.0, 9.4.0
  Known to fail||10.2.0, 8.5.0, 9.3.0
   Target Milestone|--- |9.4

[Bug c++/96155] "throw" that is not executed in constexpr function fails to compile

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96155

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Andrew Pinski  ---
Dup of bug 98672.

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

[Bug c++/98672] constexpr function - for loop with return statement doesn't get recognized as constexpr subexpression

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98672

Andrew Pinski  changed:

   What|Removed |Added

 CC||r-gcc at mail dot uk

--- Comment #7 from Andrew Pinski  ---
*** Bug 96155 has been marked as a duplicate of this bug. ***

[Bug c++/99992] Diagnose C++11 constexpr body that isn't just return even in uninstantiated templates

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=2

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-08-28

--- Comment #3 from Andrew Pinski  ---
Confirmed, this is what clang reports:
:6:3: error: use of this statement in a constexpr function is a C++14
extension [-Werror,-Wc++14-extensions]
  if (x)
  ^
:8:3: error: multiple return statements in constexpr function is a
C++14 extension [-Werror,-Wc++14-extensions]
  return false;
  ^
:7:5: note: previous return statement is here
return true;
^

Maybe we should do something similar.

[Bug c++/86105] Conversion to ambiguous/inaccessible rvalue base is valid in unevaluated context

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86105

--- Comment #1 from Johel Ernesto Guerrero Peña  ---
Denoised: https://godbolt.org/z/87fbMG6f5.
```C++
template concept is_static_castable = requires(From &&
(*from)()) { static_cast(from()); };

struct B { };
struct D : B { };
struct D2 : D, B { };
struct D3 : private B { };

void f() {
  D2 d2;
  (void)static_cast(d2);  // error: invalid
  static_assert(not is_static_castable); // says "is valid"
  D3 d3;
  (void)static_cast(d3);  // error: invalid
  static_assert(not is_static_castable); // says "is valid"
}
```
```
:5:8: warning: direct base 'B' inaccessible in 'D2' due to ambiguity
[-Winaccessible-base]
5 | struct D2 : D, B { };
  |^~
: In function 'void f()':
:10:28: error: 'B' is an ambiguous base of 'D2'
   10 |   (void)static_cast(d2);  // error: invalid
  |^
:11:17: error: static assertion failed
   11 |   static_assert(not is_static_castable); // says "is valid"
  | ^~~~
:13:28: error: 'B' is an inaccessible base of 'D3'
   13 |   (void)static_cast(d3);  // error: invalid
  |^
:14:17: error: static assertion failed
   14 |   static_assert(not is_static_castable); // says "is valid"
  | ^~~~
Compiler returned: 1
```

[Bug c++/70124] alignas error in constexpr function

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70124

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #4 from Andrew Pinski  ---
Dup of bug 84403 for the original testcase.


(In reply to Marek Polacek from comment #3)
> Another testcase:

That is valid C++14 and is accepted from GCC 8.5.0, GCC 9.1.0, and GCC 10+.

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

[Bug c++/84403] Possible further extension of constexpr: allow to use them as template parameters

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84403

Andrew Pinski  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #2 from Andrew Pinski  ---
*** Bug 70124 has been marked as a duplicate of this bug. ***

[Bug c++/55004] [meta-bug] constexpr issues

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
Bug 55004 depends on bug 70124, which changed state.

Bug 70124 Summary: alignas error in constexpr function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70124

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug c++/58601] [meta-bug] alignas

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58601
Bug 58601 depends on bug 70124, which changed state.

Bug 70124 Summary: alignas error in constexpr function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70124

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug target/102107] protocol register (r12) corrupted before a tail call

2021-08-28 Thread pc at us dot ibm.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102107

--- Comment #3 from Paul Clarke  ---
Created attachment 51371
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51371&action=edit
preprocessed source (a bit smaller)

I was able to cut out a bit more than half of the original code. It gets more
difficult from here. If this is still "too big", I can hack at it some more.

[Bug c++/94082] __builtin_memcpy in constexpr context should compile

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94082

--- Comment #7 from Andrew Pinski  ---
clang produces:
:8:5: note: cannot constant evaluate 'memcpy' from object of type
'unsigned char' to object of type 'std::uint32_t' (aka 'unsigned int')
__builtin_memcpy(&num, data, sizeof(std::uint32_t));
^

[Bug c++/93975] Wrong constexpr copy/move assignment operator allowed on non-literal type

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93975

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Keywords|rejects-valid   |accepts-invalid
   Last reconfirmed||2021-08-28
 Status|UNCONFIRMED |NEW

--- Comment #2 from Andrew Pinski  ---
Confirmed.

[Bug c++/96784] Templated lambda body remains constexpr despite having co_await in body

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96784

--- Comment #1 from Andrew Pinski  ---
Note there are some missing noexcept(true) in the testcases which I had to add
to allow it compile in a more recent GCC version.

[Bug c++/96784] Templated lambda body remains constexpr despite having co_await in body

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96784

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Dup of bug 96251.

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

[Bug c++/96251] [constexpr, coroutines] co_yield incorrectly rejected in non-explicitly-constexpr generic lambda

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96251

Andrew Pinski  changed:

   What|Removed |Added

 CC||kacper.slominski72 at gmail 
dot co
   ||m

--- Comment #12 from Andrew Pinski  ---
*** Bug 96784 has been marked as a duplicate of this bug. ***

[Bug c++/97752] incorrect address to inherited object in constexpr context

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97752

--- Comment #2 from Andrew Pinski  ---
Seems fixed on the trunk.

[Bug c++/97740] Weird error message about accessing a private member of my own class inside of std::string_view inside of constexpr

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97740

--- Comment #2 from Andrew Pinski  ---
The trunk produces:
Output of x86-64 gcc (trunk) (Compiler #2)
: In instantiation of
'cld::detail::CommandLine::Pack::parseOptionsImpl():: [with auto:6
= {const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&,
const cld::detail::CommandLine::Arg&}]':
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:2555:26:
  required by substitution of 'template static
std::__result_of_success()((declval<_Args>)()...)),
std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn =
cld::detail::CommandLine::Pack::parseOptionsImpl()::; _Args =
{const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&,
const cld::detail::CommandLine::Arg&}]'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:2566:55:
  required from 'struct std::__result_of_impl::parseOptionsImpl()::, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:151:12:
  recursively required by substitution of 'template
struct std::__is_invocable_impl<_Result, _Ret, true, std::__void_t > [with _Result =
std::__invoke_result::parseOptionsImpl()::, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>; _Ret = void]'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:151:12:
  required from 'struct
std::__and_::parseOptionsImpl()::, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>, void, true, void>,
std::__call_is_nothrow::parseOptionsImpl()::, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>,
cld::detail::CommandLine::Pack::parseOptionsImpl()::, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&> >'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:3054:12:
  required from 'struct
std::is_nothrow_invocable::parseOptionsImpl()::, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/tuple:1872:37:  
required from 'constexpr const bool std::__unpack_std_tuple struct std::is_nothrow_invocable,
cld::detail::CommandLine::Pack::parseOptionsImpl()::, const
std::tuple&>'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/tuple:1887:14:  
required from 'constexpr decltype(auto) std::apply(_Fn&&, _Tuple&&) [with _Fn =
cld::detail::CommandLine::Pack::parseOptionsImpl()::; _Tuple =
const std::tuple&]'
:408:49:   required from 'static constexpr auto
cld::detail::CommandLine::Pack::parseOptionsImpl() [with const auto&
...args = {detail::INCLUDESarg0, detail::INCLUDESarg1, detail::INCLUDESarg2}]'
:444:49:   required from 'constexpr const auto
cld::detail::CommandLine::parsedTuple >'
:458:48:   required from 'constexpr auto
cld::detail::CommandLine::parseOptions(std::string_view, cld::CLIMultiArg)
[with T = cld::detail::CommandLine::Pack; auto& ...args =
{detail::INCLUDESbind0, std::in_place_type > >}; std::string_view = std::basic_string_view]'
:502:5:   required from here
:411:31: error: too many initializers for
'std::array, 3>'
  411 | input.value...};
  |   ^


clang accepts the code using GCC's libstdc++ while rejects it using LLVM's
libc++:
:410:20: error: implicit instantiation of undefined template
'std::array'
return std::array{
   ^

[Bug c++/70380] SFINAE error with constexpr expressions referencing a non-const variable

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70380

--- Comment #4 from Andrew Pinski  ---
ICC rejects the template function f before even processing the statement.

GCC, clang and MSVC rejects the same way.

[Bug c++/101155] comparing non-capturing lambdas is not constexpr

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101155

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Dup of bug 69681.

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

[Bug c++/69681] C/C++ FEs do not consider comparisons of distinct function pointers to be constant expressions

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69681

Andrew Pinski  changed:

   What|Removed |Added

 CC||ldalessandro at gmail dot com

--- Comment #8 from Andrew Pinski  ---
*** Bug 101155 has been marked as a duplicate of this bug. ***

[Bug c++/94716] comparison of address of template variables should be constexpr

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94716

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=69681
Summary|comparison of address of|comparison of address of
   |variables should be |template variables should
   |constexpr   |be constexpr

--- Comment #2 from Andrew Pinski  ---
Reduced testcase:
template  char test_impl = 0;
static_assert(&test_impl<0> != &test_impl<1>, "should not be equal");

[Bug target/102107] protocol register (r12) corrupted before a tail call

2021-08-28 Thread pc at us dot ibm.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102107

--- Comment #4 from Paul Clarke  ---
Created attachment 51372
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51372&action=edit
preprocessed source (yet a bit smaller)

I was able to remove one of the cases of the switch statement in the function
which exhibits the issue. Interestingly, removing any of the others hides the
issue.

[Bug c++/95269] Lambda is allowed to capture any constexpr variable without specifying any captures

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95269

--- Comment #1 from Andrew Pinski  ---
GCC and ICC accept this while clang and MSVC reject this.

Without constexpr for value, GCC and ICC do reject this.

[Bug c++/99507] Can't return static address from immediate function

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99507

Johel Ernesto Guerrero Peña  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||10.3.0, 11.1.0
 Resolution|--- |FIXED
  Known to fail||10.2.0

--- Comment #5 from Johel Ernesto Guerrero Peña  ---
Thank you.

[Bug c++/95269] Lambda is allowed to capture any constexpr variable without specifying any captures

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95269

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
So I don't think this is an ODR use of the constexpr.
If I change the lambda be this, GCC rejects it correctly.

auto options_lambda = []() ->auto& { return value; };


So it all depends on what the return type of the original lambda should be
really.

[Bug c++/99507] Can't return static address from immediate function

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99507

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |10.3

[Bug c++/95412] Constexpr variables captured in templated lambdas

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95412

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=90212
 Resolution|--- |FIXED
   Target Milestone|--- |9.4
   Keywords||rejects-valid

--- Comment #1 from Andrew Pinski  ---
Fixed for GCC 9.4.0, 10.2.0 and 11+ by the patch which fixes PR 90212.

[Bug tree-optimization/99091] local array not prompted to static

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99091

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
Summary|constexpr variable  |local array not prompted to
   |evaluated at runtime|static
   Last reconfirmed||2021-08-28
   Severity|normal  |enhancement

--- Comment #3 from Andrew Pinski  ---
Confirmed, there is another bug which is very similar to this one but filed
years ago.

[Bug c++/95849] Universal forwarding constructor inheritance resolution issue

2021-08-28 Thread herring at lanl dot gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95849

S. Davis Herring  changed:

   What|Removed |Added

 CC||herring at lanl dot gov

--- Comment #1 from S. Davis Herring  ---
This is CWG2356
; GCC (along
with Clang) is correct.

[Bug tree-optimization/46186] Clang creates code running 1600 times faster than gcc's

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46186

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #28 from Andrew Pinski  ---
Dup of bug 65855.

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

[Bug middle-end/65855] SCEV / SCCP missing optimization: triangular numbers

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65855

Andrew Pinski  changed:

   What|Removed |Added

 CC||j...@jak-linux.org

--- Comment #11 from Andrew Pinski  ---
*** Bug 46186 has been marked as a duplicate of this bug. ***

[Bug c/80852] SCEV final value replacement fails to recognise sum computed by loop

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80852
Bug 80852 depends on bug 46186, which changed state.

Bug 46186 Summary: Clang creates code running 1600 times faster than gcc's
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46186

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug tree-optimization/89713] Optimize away an empty loop whose finiteness can not be analytically determined

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89713

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #12 from Andrew Pinski  ---
Dup of bug 89713.

We mark loops to be finite when -ffinite-loops is enabled (which is the case
for C++ front-end) and will remove these loops.  r10-1052 implemented part of
this and r10-7522 implemented the other part.

Note there are other loops which are marked finite on the trunk dealing with
recursive calls.

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

[Bug tree-optimization/89713] Optimize away an empty loop whose finiteness can not be analytically determined

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89713

Andrew Pinski  changed:

   What|Removed |Added

 CC||matt at godbolt dot org

--- Comment #9 from Andrew Pinski  ---
*** Bug 67809 has been marked as a duplicate of this bug. ***

[Bug c++/99141] Name of deduced type unchecked in deduction guide

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99141

Johel Ernesto Guerrero Peña  changed:

   What|Removed |Added

  Known to fail||11.0, 12.0

--- Comment #1 from Johel Ernesto Guerrero Peña  ---
Simpler: https://godbolt.org/z/EE9an4Whf.
```C++
templatestruct A{A(T){}};
using B=A;
A(int)->B;
A a{0};
```

[Bug c++/95977] No deallocation of temporary in return-statement during constant evaluation

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95977

Johel Ernesto Guerrero Peña  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||10.3.0, 11.1.0
  Known to fail||10.2.0
 Resolution|--- |FIXED

--- Comment #3 from Johel Ernesto Guerrero Peña  ---
Fixed somewhere along the line.

[Bug c++/95977] No deallocation of temporary in return-statement during constant evaluation

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95977

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
I think this was fixed via the patch for PR 99705.

[Bug c++/99141] Name of deduced type unchecked in deduction guide

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99141

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-29

--- Comment #2 from Andrew Pinski  ---
Confirmed.

  1   2   >