[Bug target/64821] [AArch64] Improve target folding for vsqrt_f64 intrinsic

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64821

--- Comment #7 from Andrew Pinski  ---
Created attachment 52151
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52151&action=edit
Patch which is in testing

[Bug target/64821] [AArch64] Improve target folding for vsqrt_f64 intrinsic

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64821

--- Comment #6 from Andrew Pinski  ---
One more testcase where we get folding now:
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times ".SQRT" 0 "optimized" } } */
/* { dg-final { scan-tree-dump-times "2.0" 1 "optimized" } } */
/* { dg-final { scan-assembler-times "fsqrt" 0 } } */
/* We should produce a fmov to d0 with 2.0 but currently don't, see PR 103959.
*/
/* { dg-final { scan-assembler-times "\n\tfmov\td0, 2.0e.0" 1 { xfail *-*-* } }
} */

#include 

float64x1_t f64(void)
{
   float64x1_t a = (float64x1_t){4.0};
   return vsqrt_f64 (a);
}

[Bug target/103959] New: float64x1_t not using fmov to generate some float values

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103959

Bug ID: 103959
   Summary: float64x1_t not using fmov to generate some float
values
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: enhancement
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
Target: aarch64-*-*

#include 
Take:
double ff(void)
{
  return 2.0;
}
float64x1_t g(void)
{
  return (float64x1_t){2.0};
}
 CUT 
These should produce the same code but currently does not.
ff:
fmovd0, 2.0e+0
ret
g:
mov x0, 4611686018427387904
fmovd0, x0
ret

I Noticed this while working on PR 64821 where we now fold sqrt but get g.

[Bug target/64821] [AArch64] Improve target folding for vsqrt_f64 intrinsic

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64821

--- Comment #5 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #4)
> I am going to fix this but maybe not until stage 1.
> 
> I think this is enough too:

It is.

A testcase too:
/* { dg-do compile } */
/* { dg-options "-fdump-tree-optimized" } */
#include 
/* { dg-final { scan-tree-dump-times "__builtin_aarch64" 0 "optimized" } } */
/* { dg-final { scan-tree-dump-times ".SQRT" 4 "optimized" } } */

float64x1_t f64(float64x1_t a)
{
  return vsqrt_f64 (a);
}

float64x2_t f64q(float64x2_t a)
{
  return vsqrtq_f64 (a);
}

float32x2_t f32(float32x2_t a)
{
  return vsqrt_f32 (a);
}

float32x4_t f32q(float32x4_t a)
{
  return vsqrtq_f32 (a);
}

[Bug rtl-optimization/63281] powerpc64le creates 64 bit constants from scratch instead of loading them

2022-01-09 Thread guojiufu at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63281

--- Comment #22 from Jiu Fu Guo  ---
On power10, loading constant only needs 1 instruction, like:
pld 9,.LC0@pcrel

And, as tests, it seems nearly as fast as using 1 instruction to build const.

[Bug rtl-optimization/98782] [11/12 Regression] Bad interaction between IPA frequences and IRA resulting in spills due to changes in BB frequencies

2022-01-09 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98782

--- Comment #36 from Hongtao.liu  ---
(In reply to pthaugen from comment #33)
> (In reply to rsand...@gcc.gnu.org from comment #32)
> > Created attachment 52102 [details]
> > Alternative patch
> > 
> > This patch is a squash of several ira tweaks that together recover the
> > pre-GCC11 exchange2 performance on aarch64.  It isn't ready for trunk
> > yet (hence lack of comments and changelog).  It would be great to hear
> > whether/how it works on other targets though.
> 
> I tried the patch on a Power9 system. Execution time went from 371 seconds
> to 291.

The patch also recover 548.exchange2_r performance on ICX, thanks.

[Bug target/64821] [AArch64] Improve target folding for vsqrt_f64 intrinsic

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64821

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
I am going to fix this but maybe not until stage 1.

I think this is enough too:
diff --git a/gcc/config/aarch64/aarch64-builtins.c
b/gcc/config/aarch64/aarch64-builtins.c
index 58bcbd9875f..1bf487477eb 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -2820,6 +2820,13 @@ aarch64_general_gimple_fold_builtin (unsigned int fcode,
gcall *stmt,
gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
break;

+  /* Lower sqrt builtins to gimple/internal function sqrt. */
+  BUILTIN_VHSDF_DF (UNOP, sqrt, 2, FP)
+   new_stmt = gimple_build_call_internal (IFN_SQRT,
+  1, args[0]);
+   gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
+   break;
+
  /*lower store and load neon builtins to gimple.  */
  BUILTIN_VALL_F16 (LOAD1, ld1, 0, LOAD)
  BUILTIN_VDQ_I (LOAD1_U, ld1, 0, LOAD)

[Bug target/64821] [AArch64] Improve target folding for vsqrt_f64 intrinsic

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64821

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2015-02-16 00:00:00 |2022-1-9

--- Comment #3 from Andrew Pinski  ---
Here is a testcase:
  #include 
  float64x1_t f(float64x1_t a)
  {
  return vsqrt_f64 (a);
  }

We should fold the __builtin_aarch64_sqrtdf into the internal function .SQRT
which is indepdent of -fno-math-errno .

[Bug c++/103954] GCC did not generate correct code for template function with O2

2022-01-09 Thread woodhead99 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103954

--- Comment #2 from Ming Zhi  ---
thanks for your great answer! I did not know the effect of strict aliasing till
today. It looks I need to update my knowledge base about c++ right now.

Get Outlook for Android

From: pinskia at gcc dot gnu.org 
Sent: Monday, January 10, 2022 12:22:24 AM
To: woodhea...@gmail.com 
Subject: [Bug c++/103954] GCC did not generate correct code for template
function with O2

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103954

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---


enum EnumSeriProto : guint32
{
seriNone = 0,
seriRidl = 1,
seriPython = 2,
seriJava = 3,
seriInvalid = 4
};




EnumSeriProto dwSeriProto = seriNone;
ret = GetSeriProto( pResp, dwSeriProto );

...
return oCfg.GetIntProp(
propSeriProto, ( guint32& )dwSeriProto );
...
gint32 GetIntProp( gint32 iProp, guint32& val ) const
{
return GetPrimProp( iProp, val );
}
...
template< typename PrimType, ... >
gint32 GetPrimProp(
gint32 iProp, PrimType& val ) const
{
gint32 ret = 0;
if( m_pConstCfg == nullptr )
return -
# 1212 "/usr/local/include/rpcf/configdb.h" 3 4
   14
# 1212 "/usr/local/include/rpcf/configdb.h"
 ;

auto pdb2 = static_cast< const CConfigDb2* const >( m_pConstCfg );
do{
const Variant* p =
pdb2->GetPropertyPtr( iProp );
if( p == nullptr )
{
ret = -
# 1220 "/usr/local/include/rpcf/configdb.h" 3 4
  2
# 1220 "/usr/local/include/rpcf/configdb.h"
;
break;
}
val = *p;

}while( 0 );

return ret;
}


enum types don't alias the underlaying type and therefore this code is
undefined at runtime.
Use Either a memcpy (or an union) inside GetSeriProto or use
-fno-strict-aliasing.

--
You are receiving this mail because:
You reported the bug.

[Bug target/72738] internal compiler error: in expand_shift_1, at expmed.c:2318

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72738

Andrew Pinski  changed:

   What|Removed |Added

   Keywords|needs-bisection |

--- Comment #6 from Andrew Pinski  ---
Which makes sense when reading the patch:
https://gcc.gnu.org/pipermail/gcc-patches/2016-September/457061.html

[Bug target/72738] internal compiler error: in expand_shift_1, at expmed.c:2318

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72738

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED
   Target Milestone|--- |7.0

--- Comment #5 from Andrew Pinski  ---
Fixed for GCC 7 by r7-3897.

[Bug target/72738] internal compiler error: in expand_shift_1, at expmed.c:2318

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72738

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code,
   ||needs-bisection

--- Comment #4 from Andrew Pinski  ---
Seems fixed in GCC 7+.

typedef __builtin_neon_poly128 poly128_t;

  int
  foo (poly128_t a, poly128_t b)
  {
return a == b;
  }

[Bug target/64154] enable fipa-ra for Thumb1

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64154

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||FIXME
   Last reconfirmed|2014-12-12 00:00:00 |2022-1-9

--- Comment #5 from Andrew Pinski  ---
Note the code is now:
  /* In Thumb1 mode, we emit the epilogue in RTL, but the last insn
 - epilogue_insns - does not accurately model the corresponding insns
 emitted in the asm file.  In particular, see the comment in thumb_exit
 'Find out how many of the (return) argument registers we can corrupt'.
 As a consequence, the epilogue may clobber registers without fipa-ra
 finding out about it.  Therefore, disable fipa-ra in Thumb1 mode.
 TODO: Accurately model clobbers for epilogue_insns and reenable
 fipa-ra.  */
  if (TARGET_THUMB1_P (opts->x_target_flags))
opts->x_flag_ipa_ra = 0;
  else
opts->x_flag_ipa_ra = to->x_flag_ipa_ra;

[Bug target/56898] stack smashing protector for alpha

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56898

Andrew Pinski  changed:

   What|Removed |Added

 Target||alpha*-*-*
   Severity|normal  |enhancement
   Last reconfirmed||2022-01-10
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #3 from Andrew Pinski  ---
Confirmed. FRAME_GROWS_DOWNWARD is still defined as 0 for alpha.

[Bug target/65651] Redundant cmp with zero instruction in loop for x86 target.

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65651

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2022-01-10

--- Comment #5 from Andrew Pinski  ---
Confirmed on the trunk still:
subl%r9d, %eax
testl   %eax, %eax
jne .L4

[Bug target/63402] ICE when using log10l() with -m96bit-long-double

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63402

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=100041
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
Since r12-94 (PR100041 fix), -m96bit-long-double is rejected for this target.


Note the ICE was fixed in GCC 6.4 and 7+ too.

[Bug target/47867] lto language is not supported on 32-bit HP-UX

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47867

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2011-10-24 00:00:00 |2022-01-09
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
IIRC 32bit hppa hpux support is scheduled to be removed for GCC 13.

[Bug middle-end/33164] Texinfo markup problems in tm.texi

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33164

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|5.0 |4.5.0

--- Comment #3 from Andrew Pinski  ---
Actually they were all fixed for GCC 4.5.0 so updating target milestone.

[Bug middle-end/33164] Texinfo markup problems in tm.texi

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33164

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
(In reply to Kai Henningsen from comment #0)
> TARGET_ASM_RELOC_RW_MASK needs return type

Fixed by r0-98054.

> TARGET_CC_MODES_COMPATIBLE needs {} around return type

The enum was removed with r5-4508 (but the {} was added back in r0-98088).

> TARGET_CHECK_PCH_TARGET_FLAGS needs {} around return type

Fixed by r0-98054.

> TARGET_DEFAULT_TARGET_FLAGS should be @deftypevr

Fixed by r0-92782.

> TARGET_GET_PCH_VALIDITY needs {} around return type

Fixed by r0-98054.

> TARGET_HAVE_SRODATA_SECTION should be @deftypevr

Fixed by r0-92782.

> TARGET_HAVE_TLS should be @deftypevr

Fixed by r0-92782.

> TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN needs {} around return type

Fixed by r0-98046.

> TARGET_INVALID_WITHIN_DOLOOP needs {} around return type

Fixed by r0-98069.

> TARGET_MAX_ANCHOR_OFFSET should be @deftypevr

Fixed by r0-92782.

> TARGET_MIN_ANCHOR_OFFSET should be @deftypevr

Fixed by r0-92782.

> TARGET_PCH_VALID_P needs {} around return type

Fixed by r0-98046.

> TARGET_STRIP_NAME_ENCODING needs {} around return type

Fixed by r0-98054.

> TARGET_TERMINATE_DW2_EH_FRAME_INFO should be @deftypevr

Fixed by r0-92782.

> TARGET_UNWIND_TABLES_DEFAULT should be @deftypevr

Fixed by r0-92782.


(In reply to Kai Henningsen from comment #1)
> Found one more: TARGET_DWARF_CALLING_CONVENTION seems to be nested inside
> DWARF2_DWARF2_DEBUGGING_INFO. Though I suspect the second half of the
> DWARF2_DEBUGGING_INFO text might actually belong to
> TARGET_DWARF_CALLING_CONVENTION.

This still seems true. I filed PR 103958 to track that since the rest were
fixed before GCC 5.

Closing as all fixed (except for the other part which I filed as PR 103958).

[Bug debug/103958] New: the target hook TARGET_DWARF_CALLING_CONVENTION is nested inside target macro DWARF2_DWARF2_DEBUGGING_INFO

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103958

Bug ID: 103958
   Summary: the target hook TARGET_DWARF_CALLING_CONVENTION is
nested inside target macro
DWARF2_DWARF2_DEBUGGING_INFO
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: documentation
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

>From PR 33164 (the rest were fixed already):
Found one more: TARGET_DWARF_CALLING_CONVENTION seems to be nested inside
DWARF2_DWARF2_DEBUGGING_INFO. Though I suspect the second half of the
DWARF2_DEBUGGING_INFO text might actually belong to
TARGET_DWARF_CALLING_CONVENTION.

[Bug fortran/103411] ICE in gfc_conv_array_initializer, at fortran/trans-array.c:6377

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103411

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |10.4
  Known to fail||10.3.0, 11.2.0
  Known to work||10.3.1, 11.2.1, 12.0

[Bug fortran/92621] Problems with memory handling with allocatable intent(out) arrays with bind(c)

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92621

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/92482] BIND(C) with array-descriptor mishandled for type character

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92482

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/94070] Assumed-rank arrays – bounds mishandled, SIZE/SHAPE/UBOUND/LBOUND

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94070

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/101309] Bind(C): gfortran creates invalid C descriptor for result of TRANSPOSE intrinsic

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101309

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/101308] Bind(C): gfortran does not create C descriptors for scalar pointer/allocatable arguments

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101308

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/92189] Fortran-written bind(C) function with allocatable argument does not update C descriptor on exit

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92189

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/102086] [F2008][TS29113] Accepts invalid scalar TYPE(*) as actual argument to assumed-rank

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102086

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/101635] FAIL: gfortran.dg/PR93963.f90 – alias-handling issue with BIND(C)'s _gfortran_cfi_desc_to_gfc_desc

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101635

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/98472] internal compiler error: in gfc_conv_expr_descriptor, at fortran/trans-array.c:7352

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98472

Andrew Pinski  changed:

   What|Removed |Added

 CC||ffadrique at gmail dot com

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

[Bug fortran/103957] ICE passing return value from elemental type bound procedure

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103957

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Dup of bug 98472. Fixed in GCC 9.5.0.

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

[Bug fortran/103957] ICE passing return value from elemental type bound procedure

2022-01-09 Thread ffadrique at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103957

--- Comment #1 from Fran Martinez Fadrique  ---
Created attachment 52150
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52150&action=edit
Main program where the error appears

[Bug fortran/103957] New: ICE passing return value from elemental type bound procedure

2022-01-09 Thread ffadrique at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103957

Bug ID: 103957
   Summary: ICE passing return value from elemental type bound
procedure
   Product: gcc
   Version: 9.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ffadrique at gmail dot com
  Target Milestone: ---

Created attachment 52149
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52149&action=edit
Type used for the type bound procedure

The attached code produces an ICE when compiled with 9.3.0 (my reference
compiler)
Does not occur with 10, 11 and 12.

The problem appears on the polymorphic array (elements) but not in the array
declared with type and fixed length. If the array is allocatable but not
polymorphic the issue does not occur either.


Compiler error follows:


fran@atlantis:~/tmp/passing_elemental$ gfortran Use.f03 Program.f03 -o
Program.bin 
Program.f03:15:0:

   15 |   call check_array( elements%get_i() )
  | 
internal compiler error: in gfc_conv_expr_descriptor, at
fortran/trans-array.c:7348
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
fran@atlantis:~/tmp/passing_elemental$

[Bug libcc1/67590] libcc1 cannot find objdump when cross build native

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67590

Tom Tromey  changed:

   What|Removed |Added

 CC||tromey at gcc dot gnu.org

--- Comment #2 from Tom Tromey  ---
This use seems to come from config/gcc-plugin.m4.
So, I think the patch ought to be applied there,
and I suppose the code from gcc/configure.in removed.

[Bug bootstrap/65763] tm.h: No such file or directory

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65763

Tom Tromey  changed:

   What|Removed |Added

 CC||townsend at astro dot wisc.edu

--- Comment #7 from Tom Tromey  ---
*** Bug 64320 has been marked as a duplicate of this bug. ***

[Bug libcc1/64320] Missing config.h during findcomp.cc compilation when srcdir=objdir

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64320

Tom Tromey  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||tromey at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #4 from Tom Tromey  ---
The patch here, that was reported as fixing the problem,
was fixed in bug #65763.

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

[Bug libcc1/63792] libcc1 doesn't built i386 multilib

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63792

Tom Tromey  changed:

   What|Removed |Added

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

--- Comment #2 from Tom Tromey  ---
I'm going to close this, as I don't think there's a bug here.
If you disagree, please reopen, and I guess then it would be
good to know why.  Thanks.

[Bug libcc1/65817] libcc1: ICE: SEGV: c_incomplete_type_error()

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65817

Tom Tromey  changed:

   What|Removed |Added

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

--- Comment #4 from Tom Tromey  ---
Tried it again today and it seems fine:

(gdb) compile code sv.p = &sv;printf("%p %p\n",&sv,sv.p);
gdb command line:1:12: warning: incompatible implicit declaration of built-in
function ‘printf’ [-Wbuiltin-declaration-mismatch]
gdb command line:1:1: note: include ‘’ or provide a declaration of
‘printf’
0x402010 0x402010


Going to close the bug this time.

[Bug tree-optimization/95140] [10/11/12 Regression] bogus -Wstringop-overflow for a loop unrolled past the end of an array

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95140

Andrew Pinski  changed:

   What|Removed |Added

 CC||martin at martin dot st

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

[Bug c/103956] [10 Regression] -Wstringop-overflow= false positive on -O3 for writes to array

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103956

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
An almost exact dup of bug 95140.

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

[Bug libstdc++/103955] std::to_chars(char*, char*, double, std::chars_format, int precision) crashes for the two maximal int precision values

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103955

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2022-01-09
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
Confirmed.
With  -fsanitize=address I get:



=
==1==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd6d9523d7
at pc 0x7f37917b829e bp 0x7ffd6d9522c0 sp 0x7ffd6d951a70
WRITE of size 2147483594 at 0x7ffd6d9523d7 thread T0
#0 0x7f37917b829d in __interceptor_memset
(/opt/compiler-explorer/gcc-11.2.0/lib64/libasan.so.6+0x3c29d)
#1 0x7f37916cafa6 
(/opt/compiler-explorer/gcc-11.2.0/lib64/libstdc++.so.6+0x162fa6)
#2 0x7f37916cb48c in std::to_chars(char*, char*, double, std::chars_format,
int) (/opt/compiler-explorer/gcc-11.2.0/lib64/libstdc++.so.6+0x16348c)
#3 0x4010fa in main /app/example.cpp:9
#4 0x7f37908c20b2 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#5 0x4011ed in _start (/app/output.s+0x4011ed)

Address 0x7ffd6d9523d7 is located in stack of thread T0 at offset 103 in frame
#0 0x40107f in main /app/example.cpp:5

  This frame has 1 object(s):
[48, 84) 'result' (line 6) <== Memory access at offset 103 overflows this
variable
HINT: this may be a false positive if your program uses some custom stack
unwind mechanism, swapcontext or vfork
  (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow
(/opt/compiler-explorer/gcc-11.2.0/lib64/libasan.so.6+0x3c29d) in
__interceptor_memset
Shadow bytes around the buggy address:
  0x10002db22420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db22430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db22440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db22450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db22460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
=>0x10002db22470: f1 f1 f1 f1 00 00 00 00 04 f3[f3]f3 f3 f3 00 00
  0x10002db22480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db22490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db224a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db224b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10002db224c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
  Shadow gap:  cc
==1==ABORTING

[Bug libstdc++/103955] std::to_chars(char*, char*, double, std::chars_format, int precision) crashes for the two maximal int precision values

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103955

--- Comment #1 from Andrew Pinski  ---
Unpreprocessed source (just in case):
#include 
#include 

int main()
{
std::array result;

// these two crash
const auto [end, ec] = std::to_chars(result.data(), result.data() +
result.size(), 1.337, std::chars_format::fixed, 2147483647);
std::to_chars(result.data(), result.data() + result.size(), 1.337,
std::chars_format::fixed, 2147483646);

// does not crash
std::to_chars(result.data(), result.data() + result.size(), 1.337,
std::chars_format::fixed, 2147483645);
return ec == std::errc{};
}

[Bug c/103956] New: [10 Regression] -Wstringop-overflow= false positive on -O3 for writes to array

2022-01-09 Thread martin at martin dot st via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103956

Bug ID: 103956
   Summary: [10 Regression] -Wstringop-overflow= false positive on
-O3 for writes to array
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: martin at martin dot st
  Target Milestone: ---

Since GCC 10.0, the following snippet produces warnings (various numbers of
warnings with the same issue) for this reduced snippet:

$ cat repro.c
struct data {
  unsigned char array[10];
};
void copy(struct data *data, unsigned char *src, int n) {
  int i;
  for (i = 0; i < n; i++)
data->array[i] = src[i];
}
$ gcc -c -O3 repro.c
repro.c: In function 'copy':
repro.c:7:20: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
7 | data->array[i] = src[i];
  | ~~~^~~~
repro.c:2:17: note: at offset 10 into destination object 'array' of size 10
2 |   unsigned char array[10];
  | ^


It doesn't reproduce at -O2.

The issue is also testable on Compiler Explorer:
https://godbolt.org/z/xsc3K37jK

[Bug fortran/103777] ICE in gfc_simplify_maskl, at fortran/simplify.c:4918

2022-01-09 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103777

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #6 from anlauf at gcc dot gnu.org ---
Fixed for gcc-12.  Closing.

Thanks for the review!

[Bug fortran/103777] ICE in gfc_simplify_maskl, at fortran/simplify.c:4918

2022-01-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103777

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

https://gcc.gnu.org/g:49d73c9fb644673323845efebfe6b3106e70af8a

commit r12-6388-g49d73c9fb644673323845efebfe6b3106e70af8a
Author: Harald Anlauf 
Date:   Mon Dec 20 22:59:53 2021 +0100

Fortran: check arguments of MASKL/MASKR intrinsics before simplification

gcc/fortran/ChangeLog:

PR fortran/103777
* simplify.c (gfc_simplify_maskr): Check validity of argument 'I'
before simplifying.
(gfc_simplify_maskl): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/103777
* gfortran.dg/masklr_3.f90: New test.

[Bug fortran/101762] ICE with "Every subscript of the target specification must be a constant expression"

2022-01-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101762

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

https://gcc.gnu.org/g:2e63128306ff93d8f53119137dd6c28b2defac94

commit r12-6387-g2e63128306ff93d8f53119137dd6c28b2defac94
Author: Harald Anlauf 
Date:   Sun Jan 9 22:08:14 2022 +0100

Fortran: reject invalid non-constant pointer initialization targets

gcc/fortran/ChangeLog:

PR fortran/101762
* expr.c (gfc_check_pointer_assign): For pointer initialization
targets, check that subscripts and substring indices in
specifications are constant expressions.

gcc/testsuite/ChangeLog:

PR fortran/101762
* gfortran.dg/pr101762.f90: New test.

[Bug libstdc++/103955] New: std::to_chars(char*, char*, double, std::chars_format, int precision) crashes for the two maximal int values

2022-01-09 Thread gcc at maxmitti dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103955

Bug ID: 103955
   Summary: std::to_chars(char*, char*, double, std::chars_format,
int precision) crashes for the two maximal int values
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc at maxmitti dot tk
  Target Milestone: ---

Created attachment 52148
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52148&action=edit
preprocessed source

Calling std::to_chars(char*, char*, double, std::chars_format, int precision)
with a precision of 2147483647 or 2147483646 and a small buffer causes a
segmentation fault.
2147483645 and smaller return an error correctly.

The preprocessed source was created with GCC 11.1.0, but the crash also happens
with compiler-explorer’s 11.2 and trunk build and even with clang 13 when using
libstdc++, but not with libc++.

Example on compiler explorer: https://godbolt.org/z/c63qbWff4

gcc output follows:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id
--enable-lto --enable-multilib --enable-plugin --enable-shared
--enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-libunwind-exceptions --disable-werror
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++20' '-Wall' '-Wextra'
'-Wpedantic' '-o' 'bug' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/cc1plus -E -quiet -v -D_GNU_SOURCE
bug.cpp -mtune=generic -march=x86-64 -std=c++20 -Wall -Wextra -Wpedantic
-fpch-preprocess -o bug.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0

/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu

/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/backward
 /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include
 /usr/local/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++20' '-Wall' '-Wextra'
'-Wpedantic' '-o' 'bug' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/cc1plus -fpreprocessed bug.ii -quiet
-dumpbase bug.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -Wall -Wextra
-Wpedantic -std=c++20 -version -o bug.s
GNU C++20 (GCC) version 11.1.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 11.1.0, GMP version 6.2.1, MPFR version
4.1.0-p13, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++20 (GCC) version 11.1.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 11.1.0, GMP version 6.2.1, MPFR version
4.1.0-p13, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e6d85a433da2a6385241e28f4582b1d3
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++20' '-Wall' '-Wextra'
'-Wpedantic' '-o' 'bug' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v --64 -o bug.o bug.s
GNU assembler version 2.36.1 (x86_64-pc-linux-gnu) using BFD version (GNU
Binutils) 2.36.1
COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++20' '-Wall' '-Wextra'
'-Wpedantic' '-o' 'bug' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
'-dumpdir' 'bug.'
 /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/collect2 -plugin
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/lto-wrapper
-plugin-opt=-fresolution=bug.res -pl

[Bug c/65253] add -Wmemsize-comparison

2022-01-09 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65253

--- Comment #4 from David Binderman  ---
(In reply to David Binderman from comment #3)
> Also happens in fedora rawhide, package gshutdown.

Also package openbox.

[Bug libcc1/67128] Makefile.in, libcc1 and --enable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67128

--- Comment #8 from Tom Tromey  ---
*** Bug 96240 has been marked as a duplicate of this bug. ***

[Bug bootstrap/96240] Error in building gcc-11 with --disable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96240

Tom Tromey  changed:

   What|Removed |Added

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

--- Comment #4 from Tom Tromey  ---
> No it is about libcc1 when --disable-shared is passed. Just it is linking
> against libstdc++ where the error is from. It might be a top level option
> that needs to similar to libjit.

Alright, in that case it really is a dup.

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

[Bug bootstrap/96240] Error in building gcc-11 with --disable-shared

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96240

Andrew Pinski  changed:

   What|Removed |Added

  Component|libstdc++   |bootstrap

--- Comment #3 from Andrew Pinski  ---
(In reply to Tom Tromey from comment #2)
> Sigh.  Un-duping this, I assumed the component was correct.
> This isn't about libcc1 at all, it's about libstdc++.
> Sorry about that.


Making all in c++17
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:561: libcc1.la]

No it is about libcc1 when --disable-shared is passed. Just it is linking
against libstdc++ where the error is from. It might be a top level option that
needs to similar to libjit.

[Bug libcc1/67128] Makefile.in, libcc1 and --enable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67128

Tom Tromey  changed:

   What|Removed |Added

 CC||skunk at iskunk dot org

--- Comment #7 from Tom Tromey  ---
*** Bug 66955 has been marked as a duplicate of this bug. ***

[Bug libcc1/66955] Bootstrap error: libcc1 compiled as shared library despite --disable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66955

Tom Tromey  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE
 CC||tromey at gcc dot gnu.org

--- Comment #6 from Tom Tromey  ---
This is a dup.

I think libcc1 has to be built shared.
So if you want --disable-shared, also use --disable-libcc1.

Maybe libcc1 should disable itself -- something to discuss
in the other bug.

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

[Bug libstdc++/96240] Error in building gcc-11 with --disable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96240

Tom Tromey  changed:

   What|Removed |Added

 Resolution|DUPLICATE   |---
 Status|RESOLVED|UNCONFIRMED
  Component|libcc1  |libstdc++

--- Comment #2 from Tom Tromey  ---
Sigh.  Un-duping this, I assumed the component was correct.
This isn't about libcc1 at all, it's about libstdc++.
Sorry about that.

[Bug libcc1/67128] Makefile.in, libcc1 and --enable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67128

Tom Tromey  changed:

   What|Removed |Added

 CC||570070308 at qq dot com

--- Comment #6 from Tom Tromey  ---
*** Bug 96240 has been marked as a duplicate of this bug. ***

[Bug libcc1/96240] Error in building gcc-11 with --disable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96240

Tom Tromey  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 CC||tromey at gcc dot gnu.org
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Tom Tromey  ---
I think this is a dup.

libcc1 has to be built shared.  Maybe it should automatically
disable itself, I don't know; but otherwise you can --disable-libcc1
if you really want a no-shared build.

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

[Bug libcc1/67128] Makefile.in, libcc1 and --enable-shared

2022-01-09 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67128

Tom Tromey  changed:

   What|Removed |Added

 CC||tromey at gcc dot gnu.org

--- Comment #5 from Tom Tromey  ---
I don't think it really makes sense to build libcc1 as a static library.
It is a gcc plugin and so has to be available for dlopen.  That's the
only way it can be used.
So I guess if you really want --disable-shared then you ought to do
as suggested in comment #3 and --disable-libcc1 as well.

[Bug fortran/103789] ICE when providing kind argument to mask{l,r}

2022-01-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103789

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Mikael Morin :

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

commit r12-6386-gc1c17a43e172ebc28f2cd247f6e83c5fdbc6219f
Author: Mikael Morin 
Date:   Fri Jan 7 22:34:59 2022 +0100

Fortran: Ignore KIND argument of a few more intrinsics. [PR103789]

After PR97896 for which some code was added to ignore the KIND argument
of the INDEX intrinsics, and PR87711 for which that was extended to
LEN_TRIM
as well, this propagates it further to MASKL, MASKR, SCAN and VERIFY.

PR fortran/103789

gcc/fortran/ChangeLog:

* trans-array.c (arg_evaluated_for_scalarization): Add MASKL,
MASKR,
SCAN and VERIFY to the list of intrinsics whose KIND argument is to
be
ignored.

gcc/testsuite/ChangeLog:

* gfortran.dg/maskl_1.f90: New test.
* gfortran.dg/maskr_1.f90: New test.
* gfortran.dg/scan_3.f90: New test.
* gfortran.dg/verify_3.f90: New test.

[Bug c++/99757] [9/10/11/12 Regression] ICE: in cp_finish_decl, at cp/decl.c:7736

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99757

Andrew Pinski  changed:

   What|Removed |Added

Summary|ICE: in cp_finish_decl, at  |[9/10/11/12 Regression]
   |cp/decl.c:7736  |ICE: in cp_finish_decl, at
   ||cp/decl.c:7736
  Known to fail||7.1.0
 Ever confirmed|0   |1
   Target Milestone|--- |9.5
   Last reconfirmed||2022-01-09
  Known to work||6.4.0
   Keywords|accepts-invalid |error-recovery
 Status|UNCONFIRMED |NEW

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

[Bug c++/103952] [9/10/11/12 Regression] ICE: in cp_finish_decl, at cp/decl.c:7933

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103952

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2022-01-09
  Known to fail||8.1.0
 Ever confirmed|0   |1
   Severity|normal  |trivial
Summary|ICE: in cp_finish_decl, at  |[9/10/11/12 Regression]
   |cp/decl.c:7933  |ICE: in cp_finish_decl, at
   ||cp/decl.c:7933
   Keywords||error-recovery
 Status|UNCONFIRMED |NEW
  Known to work||4.9.1
   Target Milestone|--- |9.5

--- Comment #2 from Andrew Pinski  ---
I think they are two different bugs here, the first one was working (no
ICE/confused by earlier errors, bailing out) in GCC 7.5.0 while the second one
is was working in 4.9.1.

[Bug c++/103954] GCC did not generate correct code for template function with O2

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103954

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---


enum EnumSeriProto : guint32
{
seriNone = 0,
seriRidl = 1,
seriPython = 2,
seriJava = 3,
seriInvalid = 4
};




EnumSeriProto dwSeriProto = seriNone;
ret = GetSeriProto( pResp, dwSeriProto );

...
return oCfg.GetIntProp(
propSeriProto, ( guint32& )dwSeriProto );
...
gint32 GetIntProp( gint32 iProp, guint32& val ) const
{
return GetPrimProp( iProp, val );
}
...
template< typename PrimType, ... >
gint32 GetPrimProp(
gint32 iProp, PrimType& val ) const
{
gint32 ret = 0;
if( m_pConstCfg == nullptr )
return -
# 1212 "/usr/local/include/rpcf/configdb.h" 3 4
   14
# 1212 "/usr/local/include/rpcf/configdb.h"
 ;

auto pdb2 = static_cast< const CConfigDb2* const >( m_pConstCfg );
do{
const Variant* p =
pdb2->GetPropertyPtr( iProp );
if( p == nullptr )
{
ret = -
# 1220 "/usr/local/include/rpcf/configdb.h" 3 4
  2
# 1220 "/usr/local/include/rpcf/configdb.h"
;
break;
}
val = *p;

}while( 0 );

return ret;
}


enum types don't alias the underlaying type and therefore this code is
undefined at runtime.
Use Either a memcpy (or an union) inside GetSeriProto or use
-fno-strict-aliasing.

[Bug c++/103954] New: GCC did not generate correct code for template function with O2

2022-01-09 Thread woodhead99 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103954

Bug ID: 103954
   Summary: GCC did not generate correct code for template
function with O2
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: woodhead99 at gmail dot com
  Target Milestone: ---

Created attachment 52147
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52147&action=edit
gcc version, command line option, .ii file and a detailed issue description

I have encountered an optimization issue with O2 option.

A variable is expected to change after a function call. but the compiler did
not generate the function correctly, more precisely the function is an inline
function, which calls a template function, but the code for the inner template
function was not generated.

The compiler seems to assume the variable keep unchanged through the call, and
optimized out the template function body.

This issue happens only with O2 option. O0 and O1 are OK.

[Bug libstdc++/103951] [C++2b] string_view range constructor, "exception specification ... depends on itself"

2022-01-09 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103951

--- Comment #2 from 康桓瑋  ---
Here is the reduced version without the header:

template 
T&& declval() noexcept;

struct true_type {
  static constexpr bool value = true;
};

template
class is_convertible {
  template
  static void __test_aux(_To1) noexcept;

  template(declval<_From1>()))>
  static true_type __test(int);

 public:
  static constexpr bool value = decltype(__test<_From, _To>(0))::value;
};

template
void __decay_copy(_Tp) noexcept(is_convertible<_Tp, _Tp>::value);

template
concept range = requires(_Tp& __t) {
  __decay_copy(__t.begin());
};

struct string_view {
  template
  string_view(R&&);
};

struct Iter {
  Iter(string_view);
  Iter begin() const { return *this; }
};

https://godbolt.org/z/nrcq84dno

[Bug c++/103953] New: Leak of coroutine return object

2022-01-09 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103953

Bug ID: 103953
   Summary: Leak of coroutine return object
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

The following code:
```
#include 
#include 

struct task {
struct promise_type;

using handle_type = std::coroutine_handle;

task(handle_type h) : handle(h) {
std::cout << "task ctor " << this << '\n';
}
task(const task & t) : handle(t.handle) {
std::cout << "task copy ctor " << this << '\n';
}
task(task && t) : handle(std::move(t.handle)) {
std::cout << "task move ctor " << this << '\n';
}
~task() {
std::cout << "task dtor " << this << '\n';
}

struct promise_type {
auto get_return_object() {
return task{handle_type::from_promise(*this)};
}

auto initial_suspend() {
return std::suspend_always {};
}

auto unhandled_exception() {}

auto final_suspend() noexcept {
return std::suspend_always{};
}

void return_void() {}
};

   handle_type handle;

   void await_resume() {
   handle.resume();
   }

   auto await_suspend(handle_type) {
   return handle;
   }

   auto await_ready() {
   return false;
   }
};

int main() {
  task coroutine_A = []() ->task {
co_return;
  }();

  task coroutine_B = [&coroutine_A]() ->task {
co_await coroutine_A;
  }();

  coroutine_B.handle.resume();
}

```
prints
```
task ctor 0x7ffc85d3d598
task ctor 0x7ffc85d3d590
task copy ctor 0x194af30
task dtor 0x7ffc85d3d590
task dtor 0x7ffc85d3d598
```
meaning that one instance of task was not destructed (0x194af30).

Demo: https://gcc.godbolt.org/z/6vnoMGvxo

Related discussion: https://stackoverflow.com/q/70632655/7325599

[Bug c++/103952] ICE: in cp_finish_decl, at cp/decl.c:7933

2022-01-09 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103952

--- Comment #1 from 康桓瑋  ---
Segmentation fault:

template
struct A {
  template
  static constexpr auto c = [] { return Is; }();
  using type = decltype(c<0>);
};

#include
int main() {
  typename A>::type x;
}

https://godbolt.org/z/EbdanW16d

[Bug c++/103952] New: ICE: in cp_finish_decl, at cp/decl.c:7933

2022-01-09 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103952

Bug ID: 103952
   Summary: ICE: in cp_finish_decl, at cp/decl.c:7933
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hewillk at gmail dot com
  Target Milestone: ---

12 regression:

template
struct A {
  template
  struct B {
static constexpr auto c = [] { return Is; }();
using type = decltype(c);
  };
};

#include
int main() {
  typename A>::B<0>::type x;
}

https://godbolt.org/z/fxvKWP4qM

[Bug debug/100530] [9/10/11/12 Regression] ICE with -g: in add_dwarf_attr with __seg_gs (Alternative address-space) global variable since r8-4385-ga297ccb52e0c894e

2022-01-09 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100530

Thomas Schwinge  changed:

   What|Removed |Added

  Component|target  |debug
   Keywords|accepts-invalid,|ice-on-valid-code
   |ice-on-invalid-code |
 Target|x86_64-linux-gnu|all x86
   Last reconfirmed|2021-08-19 00:00:00 |2022-1-9
 CC||rguenth at gcc dot gnu.org

--- Comment #7 from Thomas Schwinge  ---
Per PR101975 (which I've just ran into again, compiling
'libgomp.c/address-space-1.c' with '-g -S -foffload=disable'), we understand
this to be a Component: debug problem, and Keywords: ice-on-valid-code.

[Bug target/100799] Stackoverflow in optimized code on PPC

2022-01-09 Thread kenneth.hoste at ugent dot be via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100799

--- Comment #6 from Kenneth Hoste  ---
(In reply to Segher Boessenkool from comment #3)
> Hi Alexander,
> 
> You do not say what the actual target you used is?  powerpc-linux,
> powerpc64-linux, powerpc64le-linux, something else entirely?

We're definitely seeing this on ppc64le, see also
https://github.com/mpimd-csc/flexiblas/issues/17 and
https://github.com/easybuilders/easybuild-easyconfigs/issues/12968 for
additional context.

[Bug libstdc++/103951] [C++2b] string_view range constructor, "exception specification ... depends on itself"

2022-01-09 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103951

康桓瑋  changed:

   What|Removed |Added

 CC||hewillk at gmail dot com

--- Comment #1 from 康桓瑋  ---
Reduced a bit:

#include 

struct string_view {
  string_view(std::ranges::range auto&&);
};

struct Iter {
  Iter(string_view);
  Iter begin() const { return *this; }
};

https://godbolt.org/z/n93o9f9nK

[Bug libstdc++/103951] New: [C++2b] string_view range constructor, "exception specification ... depends on itself"

2022-01-09 Thread iamsupermouse at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103951

Bug ID: 103951
   Summary: [C++2b] string_view range constructor, "exception
specification ... depends on itself"
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamsupermouse at mail dot ru
  Target Milestone: ---

Following code compiles with -std=c++20 and earlier, but fails with -std=c++2b,
in both GCC and Clang with libstdc++, with similar errors.

I've tested both on GCC 11.2 and on trunk 12.0.0 20220109 at gcc.godbolt.org.

#include 

struct Iter
{
Iter() {}
Iter(std::string_view) {} // Adding `explicit` fixes the error

Iter begin() const
{
return *this;
}
};

It's supposed to be used as `for (auto x : Iter(...))`, exactly like
`fs::directory_iterator`, but I've removed `end()` and overloaded operators for
brevity.

The error message boils down to `return *this` considering the `string_view`
constructor, which checks `Iter` against `contiguous_range`, which circularly
checks `begin()`.

I'm not sure if the code is legal or not, but the error is very unintuitive, so
I decided to report it. I would expect this to be a soft SFINAE failure.

[Bug lto/69254] [6 Regression] ICE in streamer_get_builtin_tree when using -fsanitize=shift on the compile side only

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69254

Andrew Pinski  changed:

   What|Removed |Added

 CC||steven at uplinklabs dot net

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

[Bug sanitizer/65828] [LTO] ICE in streamer_get_builtin_tree, at tree-streamer-in.c:1127

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65828

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #12 from Andrew Pinski  ---
Dup of bug 69254, fixed for GCC 6.

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

[Bug lto/56601] OpenBSD lto-plugin fails to use

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56601

Andrew Pinski  changed:

   What|Removed |Added

  Component|target  |lto
 Status|WAITING |UNCONFIRMED
 CC||marxin at gcc dot gnu.org
 Ever confirmed|1   |0

[Bug target/56601] OpenBSD lto-plugin fails to use

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56601

--- Comment #6 from Andrew Pinski  ---
(In reply to mail from comment #5)
> Hi,
> 
> following change fixed it for me:

That is obvious not the correct fix. I suspect this is a libtool issue 

[Bug c/78539] feature request: __noextension__

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78539

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2022-01-09
 Ever confirmed|0   |1
   Keywords||diagnostic

[Bug libstdc++/103891] clang-13 fails to compile libstdc++'s std::variant>: error: attempt to use a deleted function

2022-01-09 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103891

--- Comment #5 from Sergei Trofimovich  ---
(In reply to Jonathan Wakely from comment #4)
> I suppose we could just do:
> 
> --- a/libstdc++-v3/include/std/variant
> +++ b/libstdc++-v3/include/std/variant
> @@ -54,7 +54,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
>  {
>  _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  
> -#if __cplusplus >= 202002L && __cpp_concepts
> +#if __cplusplus >= 202002L && __cpp_concepts && __GNUC__ >= 12
>  // P2231R1 constexpr needs constexpr unions and constrained destructors.
>  # define __cpp_lib_variant 202106L
>  #else
> 
> And then improve it later if GCC updates __cpp_concepts

That almost works:

In file included from bug.cc:12:
stdc++-include/c++/12.0.0/variant:300:18: error: no template named
'__aligned_membuf' in namespace '__gnu_cxx'
  __gnu_cxx::__aligned_membuf<_Type> _M_storage;
  ~~~^

On clang it also needs `#include ` as well.

[Bug hsa/86948] Internal compiler error compiling brig.dg/test/gimple/mulhi.hsail

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86948

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|11.0|12.0

--- Comment #11 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #10)
> As mentioned the brig front-end was removed in GCC 11 so closing as won't
> fix.

Actually it was removed for GCC 12 by r12-717.

[Bug hsa/86948] Internal compiler error compiling brig.dg/test/gimple/mulhi.hsail

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86948

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|NEW |RESOLVED
   Target Milestone|--- |11.0

--- Comment #10 from Andrew Pinski  ---
As mentioned the brig front-end was removed in GCC 11 so closing as won't fix.

[Bug other/101810] libiberty/simple-object-xcoff.c segmentation fault

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101810

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2022-01-09
  Component|lto |other
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Keywords||lto

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

[Bug plugins/45348] cp/cp-tree.h in plugin header does not work.

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45348

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED
   Target Milestone|--- |4.7.0

--- Comment #3 from Andrew Pinski  ---
Fixed by r176741 for GCC 4.7.0.

[Bug plugins/48425] installed plugin headers fail to compile, include non-existent files

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48425

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Fixed since GCC 4.7.0 by r176741.

[Bug plugins/46042] install-plugin rule exceeds argument line length on a host with argument list limitations

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46042

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Fixed for GCC 12 by r12-5764.

[Bug c++/62252] a callback to event PLUGIN_FINISH_TYPE should be moved such that it is only after checking definitely parsing is done

2022-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62252

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |NEW