[Bug c++/101712] New: Bad error message with reference to nested type.

2021-08-01 Thread tobi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101712

Bug ID: 101712
   Summary: Bad error message with reference to nested type.
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tobi at gcc dot gnu.org
  Target Milestone: ---

==
template
class pq;

template
class A {
struct QD {
int a;
struct Comparator {
};
};
pq queueBad;
pq queueCorrect;
};
==

gives (https://godbolt.org/z/n7v97z17s):
++
:11:31: error: type/value mismatch at argument 3 in template parameter
list for 'template class pq'
   11 | pq queueBad;
  |   ^
:11:31: note:   expected a type, got 'A::QD::Comparator'
++

To which my response is "A::QD::Comparator is a type".  Compare this to
clang's clear and actionable:
--
:11:17: error: template argument for template type parameter must be a
type; did you forget 'typename'?
pq queueBad;
^
typename 
:1:34: note: template parameter is declared here
template
 ^
1 error generated.
--

Besides not being actionable, "type/value mismatch" appears to be a
compiler-internal category of problem and thus isn't very user-friendly.

[Bug middle-end/82940] Suboptimal code for (a & 0x7f) | (b & 0x80) on powerpc

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
 CC||pinskia at gcc dot gnu.org

--- Comment #4 from Andrew Pinski  ---
I have a set of patches that I am going to clean up next year for GCC 13 where
on the gimple level GCC produces:
  _13 = v_9(D) & 127;
  _1 = (sizetype) _13;
  _2 = t_10(D) + _1;
  _3 = *_2;
  _14 = () _3;
  _12 = BIT_INSERT_EXPR ;
  return _12;

As long as nothing on the rtl level (combine) does not mess this up, it should
produce the best code.

[Bug middle-end/77779] unnecessary trap checks for pointer subtraction with -ftrapv

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

Andrew Pinski  changed:

   What|Removed |Added

 Depends on||101521

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> This might be fixed now but I could be wrong.

I am 100% wrong about it being fixed.

>There's a separate bug about this as well.
PR 101521 now.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101521
[Bug 101521] -ftrapv should become something like -fsanitize=undefined
-fsanitize-undefined-trap-on-error

[Bug analyzer/101713] New: -Wanalyzer-malloc-leak false positive with GNU coreutils hash table code

2021-08-01 Thread eggert at cs dot ucla.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101713

Bug ID: 101713
   Summary: -Wanalyzer-malloc-leak false positive with GNU
coreutils hash table code
   Product: gcc
   Version: 11.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: eggert at cs dot ucla.edu
  Target Milestone: ---

Because of GCC bug 94458 we've been disabling -Wanalyzer-malloc-leak when
compiling Gnulib-based code such as GNU coreutils. Since GCC bug 94458 is fixed
I thought I'd try enabling that warning. I simplified the first false positive
I ran into (in gnulib/lib/exclude.c) to the following:

void free (void *);
char *xstrdup (char const *)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (free, 1)))
  __attribute__ ((__returns_nonnull__));
void *hash_insert (void const *entry);

void
addpat (char *pattern)
{
  char *str = xstrdup (pattern);
  hash_insert (str);
}

For this example, the command 'gcc -fanalyzer -Wanalyzer-too-complex -O2 -S
t1.i' outputs the following diagnostic, which is a false alarm because 'str'
has been put into a hash table and has not leaked. Omitting the 'const' from
the declaration of the 'entry' formal parameter makes the false alarm go away,
but we shouldn't have to omit the 'const'. For now, I think we'll continue to
disable -Wanalyzer-too-complex in Gnulib-derived code.

t1.i: In function ‘addpat’:
t1.i:12:1: warning: leak of ‘str’ [CWE-401] [-Wanalyzer-malloc-leak]
   12 | }
  | ^
  ‘addpat’: events 1-2
|
|   10 |   char *str = xstrdup (pattern);
|  |   ^
|  |   |
|  |   (1) allocated here
|   11 |   hash_insert (str);
|   12 | }
|  | ~
|  | |
|  | (2) ‘str’ leaks here; was allocated at (1)
|

[Bug tree-optimization/36190] Investigate which tests need -fno-trapping-math

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|testsuite   |tree-optimization
   Severity|normal  |enhancement
 Blocks|54192   |


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54192
[Bug 54192] -fno-trapping-math by default?

[Bug tree-optimization/79355] poor code for AVX vector compare

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Last reconfirmed|2017-02-06 00:00:00 |2021-8-1
  Component|middle-end  |tree-optimization

--- Comment #2 from Andrew Pinski  ---
Yes expand_vector_comparison does not try piecewise at all.

[Bug d/101692] Referenses in Slist are not counted by GC

2021-08-01 Thread zed at lab127 dot karelia.ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101692

--- Comment #7 from Eugene Zhiganov  ---
(In reply to Eugene Zhiganov from comment #5)
> This rxMachines array is just for the purpose of holding references,
> since references in linked list are not counted at all by GC.

Maybe I am not right here...

Things a little bit more complicated.
Initially objects were created like this:

auto rxPool = new RestRoom();
for (int k = 0; k < maxClients; k++) {
auto sm = new RxSm(rxPool);
sm.run();
}

After the the loop 'sm' is out of scope
and all these just created instances
are marked for deletion I guess.

RxSm has 3 states, INIT, IDLE and WORK.
run() method calls enter function for INIT state.
In this function rx do some initalization
and send a message to self (message means
'now go to IDLE state').

A little bit later, when program enters event loop
and starts processing messages, that message
is processed, machine enters IDLE state,
where it puts itself into a pool like this:

void rxIdleEnter() {
rR.put(this);
// adds 'this' pointer to Slist
}

But at this moment the instance is already marked
for deletion... and hence reference in the list
is not counted either because of

* object was marked for deletion

or because of

* references in Slist are not counted at all (???)

[Bug tree-optimization/82905] vector shift forced to 32 bits

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|middle-end  |tree-optimization
   Severity|normal  |enhancement

--- Comment #3 from Andrew Pinski  ---
So the vectorizer produces now:
  vect_cst__7 = {m_9(D), m_9(D), m_9(D), m_9(D), m_9(D), m_9(D), m_9(D),
m_9(D)};
  vect__1.5_3 = MEM  [(unsigned char *)&p];
  vect__2.6_4 = [vec_unpack_lo_expr] vect__1.5_3;
  vect__2.6_5 = [vec_unpack_hi_expr] vect__1.5_3;
  vect__3.7_11 = vect__2.6_4 * vect_cst__7;
  vect__3.7_19 = vect__2.6_5 * vect_cst__7;
  vect__4.8_10 = vect__3.7_11 >> 8;
  vect__4.8_30 = vect__3.7_19 >> 8;
  vect__5.9_31 = VEC_PACK_TRUNC_EXPR ;
  MEM  [(unsigned char *)&p] = vect__5.9_31;

 CUT 

[Bug tree-optimization/85560] Missed optimization in niter analysis for bit-by-bit variable zeroing

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|middle-end  |tree-optimization
   Severity|normal  |enhancement

--- Comment #2 from Andrew Pinski  ---
For C++, we can optimize away the code since r10-1052 (well it is turned on by
default for all langauges at that point but later on turned on for C++ only in
r10-7522).

[Bug tree-optimization/85560] Missed optimization in niter analysis for bit-by-bit variable zeroing

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

--- Comment #3 from Andrew Pinski  ---
I should note clang is able to figure this is finite and able to remove the
loop even in C mode.

[Bug fortran/101660] [12 Regression] FAIL: gfortran.dg/bind_c_array_params_3.f90

2021-08-01 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101660

--- Comment #4 from Tobias Burnus  ---
Submitted testsuite patch:
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576278.html

[Bug ipa/86140] constprop clones with identical bodies

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org
   Severity|normal  |enhancement
  Component|middle-end  |ipa

[Bug c++/101710] Sometimes constexpr cannot be used as constexpr

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #2 from Andrew Pinski  ---
Can you re-upload the zip file as it seems be corrupted?

[Bug testsuite/101678] [12 regression] many fortran errors afterr r12-2553

2021-08-01 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101678

Tobias Burnus  changed:

   What|Removed |Added

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

--- Comment #2 from Tobias Burnus  ---
Sorry for the breakage.

See PR 101660 for some background / analysis. (+ marked this PR as duplicate of
the other one)

Note there is a submitted patch:
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576278.html

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

[Bug fortran/101660] [12 Regression] FAIL: gfortran.dg/bind_c_array_params_3.f90

2021-08-01 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101660

Tobias Burnus  changed:

   What|Removed |Added

 CC||seurer at gcc dot gnu.org

--- Comment #5 from Tobias Burnus  ---
*** Bug 101678 has been marked as a duplicate of this bug. ***

[Bug c++/101710] Sometimes constexpr cannot be used as constexpr

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

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> Can you re-upload the zip file as it seems be corrupted?

Never mind, I was able to extract it, I had to use winrar rather than the
builtin unziper in windows or Info-ZIP unzip on Linux.

[Bug c++/101710] Sometimes constexpr cannot be used as constexpr

2021-08-01 Thread steve_green at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101710

--- Comment #4 from steve02081504  ---
Created attachment 51235
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51235&action=edit
.ii file & .s file & output - Deflate64

Deflate64 zip added.

[Bug c++/101710] Sometimes constexpr cannot be used as constexpr

2021-08-01 Thread steve_green at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101710

--- Comment #5 from steve02081504  ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > Can you re-upload the zip file as it seems be corrupted?
> 
> Never mind, I was able to extract it, I had to use winrar rather than the
> builtin unziper in windows or Info-ZIP unzip on Linux.

Sorry, I think I used LZMA format in the compressed package, which is probably
not supported by the standard ZIP format.

[Bug c++/101710] Sometimes constexpr cannot be used as constexpr

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

--- Comment #6 from Andrew Pinski  ---
Changing:
  if
constexpr(type_info.has_attribute_helper()&&type_info.not_has_has_attribute_helper())

to:
  if constexpr(type_info.template
has_attribute_helper()&&type_info.template
not_has_has_attribute_helper())

Fixes many of the errors
Note the use of template.

Note there are cases where GCC does not realize the template keyword is not
needed but I don't know if it is actually needed in this case or not.  I
suspect it is.

[Bug c++/101710] Sometimes constexpr cannot be used as constexpr

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

--- Comment #7 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #6)
> Changing:
>   if
> constexpr(type_info.
> has_attribute_helper()&&type_info.
> not_has_has_attribute_helper())
> 
> to:
>   if constexpr(type_info.template
> has_attribute_helper()&&type_info.template
> not_has_has_attribute_helper())
> 
> Fixes many of the errors
> Note the use of template.

This shows up in many places in your files.

There was two other errors I noticed:
* aligned_alloc is not defined; mingw does not define aligned_alloc I think.
* is_pointer should have been std::is_pointer_v as far as I can tell.

[Bug c++/101710] Sometimes constexpr cannot be used as constexpr

2021-08-01 Thread steve_green at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101710

steve02081504  changed:

   What|Removed |Added

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

--- Comment #8 from steve02081504  ---
(In reply to Andrew Pinski from comment #6)
> Changing:
>   if
> constexpr(type_info.
> has_attribute_helper()&&type_info.
> not_has_has_attribute_helper())
> 
> to:
>   if constexpr(type_info.template
> has_attribute_helper()&&type_info.template
> not_has_has_attribute_helper())
> 
> Fixes many of the errors
> Note the use of template.
> 
> Note there are cases where GCC does not realize the template keyword is not
> needed but I don't know if it is actually needed in this case or not.  I
> suspect it is.

So I just need to add "template" to these errors?
Well, although it doesn't look very beautiful, I think I latched on
This is my code's problem, not GCC's ICE, right
thank you

[Bug middle-end/82940] Suboptimal code for (a & 0x7f) | (b & 0x80) on powerpc

2021-08-01 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82940

--- Comment #5 from Segher Boessenkool  ---
(In reply to Andrew Pinski from comment #4)
> As long as nothing on the rtl level (combine) does not mess this up, it
> should produce the best code.

combine cannot ever create worse code than it had as input :-)

[Bug target/101714] New: [POWER] vec_min / vec_max handles NaN incorrectly when evaluated at compile time

2021-08-01 Thread evan--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101714

Bug ID: 101714
   Summary: [POWER] vec_min / vec_max handles NaN incorrectly when
evaluated at compile time
   Product: gcc
   Version: 10.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: e...@coeus-group.com
  Target Milestone: ---

When a call to vec_min or vec_max with one numeric value and one NaN is
evaluated at compile time, the result is NaN instead of the numeric value.

Here is a quick test case:


#include 
#include 

#if defined(NO_INLINE)
__attribute__((__noinline__))
#endif
__vector float
foo(__vector float a, __vector float b) {
  return vec_min(a, b);
}

int main(void) {
  __vector float a = { 1.0f, __builtin_nanf(""), __builtin_nanf(""), 1.0f };
  __vector float b = { __builtin_nanf(""), 1.0f, __builtin_nanf(""), 1.0f };
  __vector float r = foo(a, b);
  for (int i = 0 ; i < 4 ; i++) {
printf("%f\n", r[i]);
  }
}


$ gcc -O3 -o minmax minmax.c && ./minmax
nan
nan
nan
1.00
$ gcc -DNO_INLINE -O3 -o minmax minmax.c && ./minmax
1.00
1.00
nan
1.00
$ gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[Bug target/89252] Vector load/store aren't used to initialize large memory

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
  Component|middle-end  |target
 Target||x86_64-linux-gnu

--- Comment #4 from Andrew Pinski  ---
On the trunk we get:
movdqa  xmm0, XMMWORD PTR _ZL5array[rip]
movdqa  xmm1, XMMWORD PTR _ZL5array[rip+16]
movdqa  xmm2, XMMWORD PTR _ZL5array[rip+32]
movdqa  xmm3, XMMWORD PTR _ZL5array[rip+48]
movdqa  xmm4, XMMWORD PTR _ZL5array[rip+64]
movdqa  xmm5, XMMWORD PTR _ZL5array[rip+80]
movups  XMMWORD PTR [rdi], xmm0
movdqa  xmm6, XMMWORD PTR _ZL5array[rip+96]
movdqa  xmm7, XMMWORD PTR _ZL5array[rip+112]
movups  XMMWORD PTR [rdi+16], xmm1
movups  XMMWORD PTR [rdi+32], xmm2
movups  XMMWORD PTR [rdi+48], xmm3
movups  XMMWORD PTR [rdi+320], xmm4
movups  XMMWORD PTR [rdi+336], xmm5
movups  XMMWORD PTR [rdi+352], xmm6
movups  XMMWORD PTR [rdi+368], xmm7

Even with -mavx which I had assumed would use the ymm registers.

[Bug fortran/99368] ICE in build_function_decl, at fortran/trans-decl.c:2381

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

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org
   Priority|P3  |P4

--- Comment #2 from kargl at gcc dot gnu.org ---
% gfc -c z1.f90

2 |type y
  | 1
..
7 |   namelist /x/ y
  |2
Error: Derived type 'y' at (1) conflicts with namelist object 'y' at (2)

diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index d148de3e3b5..6bde5707926 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -5551,10 +5582,32 @@ gfc_match_namelist (void)
  gfc_error_check ();
}
  else
-   /* If the type is not set already, we set it here to the
-  implicit default type.  It is not allowed to set it
-  later to any other type.  */
-   gfc_set_default_type (sym, 0, gfc_current_ns);
+   {
+ /* Before the symbol is given an implicit type, check to
+see if the symbol is already available in the namespace,
+possibly through host association.  Importantly, the
+symbol may be a user defined type.  */
+
+ gfc_symbol *tmp;
+
+ gfc_find_symbol (sym->name, NULL, 1, &tmp);
+ if (tmp
+ && tmp->attr.generic
+ && (tmp = gfc_find_dt_in_generic (tmp)))
+   {
+ if (tmp->attr.flavor == FL_DERIVED)
+   {
+ gfc_error ("Derived type %qs at %L conflicts with "
+"namelist object %qs at %C", 
+tmp->name, &tmp->declared_at, sym->name);
+ goto error;
+   }
+   }
+
+ /* Set type of the symbol to its implicit default type.  It
is
+not allowed to set it later to any other type.  */
+ gfc_set_default_type (sym, 0, gfc_current_ns);
+   }
}
  if (sym->attr.in_namelist == 0
  && !gfc_add_in_namelist (&sym->attr, sym->name, NULL))

[Bug tree-optimization/82885] memcpy does not propagate aliasing knowledge

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|middle-end  |tree-optimization
   Severity|normal  |enhancement

--- Comment #4 from Andrew Pinski  ---
The original testcase is fixed in GCC 8+:
   [local count: 1073741825]:
  __builtin_memcpy (ch1_3(D), ch2_4(D), 1048576);
  _1 = MEM[(const char *)ch2_4(D) + 2B];
  *ch1_3(D) = _1;
  MEM[(char *)ch1_3(D) + 1B] = _1;

fre1 is able to figure this out but this is not exactly propagating aliasing
info, just that the value of ch2[2] cannot change if ch1[0] is stored with the
same value of what was in ch2[2]; memcpy is not needed to show that :).

A better testcase which shows there is still a missing aliasing case:
void foo3(char* ch1, char* ch2) {
__builtin_memcpy(ch1, ch2, 1024*1024);
ch1[0] = ch2[2] + 1;
ch1[1] = ch2[2];
}

[Bug tree-optimization/92408] strlen(s) != 0 not folded into *s

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

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Severity|normal  |enhancement
 Status|UNCONFIRMED |NEW
  Component|middle-end  |tree-optimization
   Last reconfirmed||2021-08-01

--- Comment #2 from Andrew Pinski  ---
Confirmed.
The code is located in fold_binary_loc in fold-const.c, moving it to match.pd
might need some patching to support adding of loads in the case of
-fnon-call-exceptions.

[Bug target/89252] Vector load/store aren't used to initialize large memory

2021-08-01 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89252

H.J. Lu  changed:

   What|Removed |Added

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

--- Comment #5 from H.J. Lu  ---
Fixed for GCC 12 by r12-978.

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

[Bug middle-end/90773] Improve piecewise operation

2021-08-01 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90773

--- Comment #10 from H.J. Lu  ---
*** Bug 89252 has been marked as a duplicate of this bug. ***

[Bug middle-end/92282] gimple for (a + ~b) is harder to optimize in RTL when types are unsigned

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Last reconfirmed|2019-10-30 00:00:00 |2021-8-1

[Bug c++/101715] New: compiler ice when uses a GCC cross compiler to canadian compile LLVM libc++

2021-08-01 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101715

Bug ID: 101715
   Summary: compiler ice when uses a GCC cross compiler to
canadian compile LLVM libc++
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: unlvsur at live dot com
  Target Milestone: ---

Created attachment 51236
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51236&action=edit
noexcept crash??

libc++ defines _NOEXCEPT_ macro and crashes

[Bug tree-optimization/91881] Value range knowledge of higher bits not used in optimizations

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|middle-end  |tree-optimization
   Severity|normal  |enhancement
   Last reconfirmed|2019-09-25 00:00:00 |2021-8-1

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

unsigned long long sample2(unsigned long long m) {
if (((unsigned int)m) != m) __builtin_unreachable();
m <<= 4;
return m >> 3;
}


unsigned long long sample1(unsigned long long m) {
if (((unsigned int)m) != m) __builtin_unreachable();
unsigned long t = -1;
t <<= 1;
m <<= 4;
return (m >> 3) & t;
}


unsigned long long sample(unsigned long long m) {
if (m >= 100) __builtin_unreachable();
return m << 1;
}

[Bug c++/101715] compiler ice when uses a GCC cross compiler to canadian compile LLVM libc++

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

--- Comment #1 from Andrew Pinski  ---
Can you attach the preprocessed source?  It is most likely a known issue which
we just don't hit in our libstdc++.

[Bug target/101716] New: lea does not have a zero_extend version of it

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

Bug ID: 101716
   Summary: lea does not have a zero_extend version of it
   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: x86_64-*-*

Take:
unsigned long long sample1(unsigned long long m) {
unsigned int t = -1;
return (m << 1) & t;
}

 CUT 
Currently we produce:
lea rax, [rdi+rdi]
mov eax, eax

But really we should just produce:
lea eax, [rdi + rdi]
ret

Note I noticed a few other related addressing modes missing too.

[Bug middle-end/91869] Constant bitfield assignment causes unnecessary use of memory and instructions

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Last reconfirmed|2019-09-24 00:00:00 |2021-8-1

[Bug tree-optimization/94651] Missed peephole optimization: m >= POWER_OF_TWO || n >= POWER_OF_TWO

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED
   Severity|normal  |enhancement
  Component|middle-end  |tree-optimization

--- Comment #1 from Andrew Pinski  ---
Fixed in GCC 11+:
_Z5checkmm:
or  rdi, rsi
xor eax, eax
cmp rdi, 1048575
setaal
ret
_Z5test1mm:
or  rsi, rdi
cmp rsi, 1048575
ja  .L5
ret
.L5:
xor esi, esi
jmp _Z1gmm
_Z5test2mm:
mov rax, rdi
or  rax, rsi
cmp rax, 1048575
ja  .L8
ret
.L8:
jmp _Z1gmm

This was done by PR 56719 which is an exact dup.

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

[Bug middle-end/56719] missed optimization: i > 0xffff || i*4 > 0xffff

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||pascal_cuoq at hotmail dot com

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

[Bug middle-end/56719] missed optimization: i > 0xffff || i*4 > 0xffff

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

[Bug tree-optimization/56719] missed optimization: i > 0xffff || i*4 > 0xffff

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
  Component|middle-end  |tree-optimization

[Bug middle-end/98236] x plus/minus y cmp 0 produces unoptimal code

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Last reconfirmed|2020-12-11 00:00:00 |2021-8-1

[Bug tree-optimization/98709] gcc optimizes bitwise operations, but doesn't optimize logical ones

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

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Depends on||101706
   Last reconfirmed||2021-08-01
  Component|middle-end  |tree-optimization
 Status|UNCONFIRMED |NEW
   Severity|normal  |enhancement

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

I noticed the ~(a^b) issue the other day (not even knowing about this bug) and
filed PR 101706 for that :)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101706
[Bug 101706] bool0^bool1^1 -> bool0 == bool1

[Bug tree-optimization/100046] compare with itself

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
  Component|middle-end  |tree-optimization
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
 CC||pinskia at gcc dot gnu.org
   Last reconfirmed||2021-08-01

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

Note we don't figure out they are the same on arm64 until post register
allocation even :).

[Bug middle-end/95014] gcc fails to merge two identical returns

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-08-01
   Severity|normal  |enhancement

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

Note I have not looked into why but on aarch64-linux-gnu GCC can remove the
cmp/jump.

[Bug bootstrap/79885] --with-build-sysroot= does not get honored throughout the build (fix-includes, CPP, CXXCPP, configure-stage2)

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|other   |bootstrap
 Depends on||37036

--- Comment #16 from Andrew Pinski  ---
fixincludes is PR 37036.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37036
[Bug 37036] fixincludes does not understand sysroot!

[Bug libgcc/52100] CRTSTUFF_CFLAGS needs -fno-asynchronous-unwind-tables

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|other   |libgcc
   Last reconfirmed|2012-02-03 00:00:00 |2021-8-1

--- Comment #2 from Andrew Pinski  ---
ChangeLog:  -fno-asynchronous-unwind-tables.
ChangeLog:  * config/tilegx/t-crtstuff: Add -fno-asynchronous-unwind-tables
config/i386/t-crtstuff:# crtend*.o cannot be compiled without
-fno-asynchronous-unwind-tables,
config/i386/t-crtstuff:# section.  -fno-asynchronous-unwind-tables is off by
default for i386
config/i386/t-crtstuff:CRTSTUFF_T_CFLAGS += -fno-omit-frame-pointer
-fno-asynchronous-unwind-tables
config/rs6000/t-crtstuff:CRTSTUFF_T_CFLAGS = -msdata=none -O2
-fno-asynchronous-unwind-tables
config/s390/t-crtstuff:# crtend*.o cannot be compiled without
-fno-asynchronous-unwind-tables,
config/s390/t-crtstuff:CRTSTUFF_T_CFLAGS += -fno-asynchronous-unwind-tables
config/s390/t-crtstuff:CRTSTUFF_T_CFLAGS_S += -fno-asynchronous-unwind-tables
config/tilegx/t-crtstuff:# crtend*.o cannot be compiled without
-fno-asynchronous-unwind-tables,
config/tilegx/t-crtstuff:CRTSTUFF_T_CFLAGS += -fno-asynchronous-unwind-tables
config/tilegx/t-crtstuff:CRTSTUFF_T_CFLAGS_S += -fno-asynchronous-unwind-tables
config/tilepro/t-crtstuff:# crtend*.o cannot be compiled without
-fno-asynchronous-unwind-tables,
config/tilepro/t-crtstuff:CRTSTUFF_T_CFLAGS += -fno-asynchronous-unwind-tables
configure:  if { ac_try='${CC-cc} -Werror -g
-fno-asynchronous-unwind-tables -fno-unwind-tables -fno-exceptions -S
conftest.c -o conftest.s 1>&5'
configure.ac:   if AC_TRY_COMMAND(${CC-cc} -Werror -g
-fno-asynchronous-unwind-tables -fno-unwind-tables -fno-exceptions -S
conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then

Only one target adds -fasynchronous-unwind-tables in one place:
config/riscv/t-elf:LIB2_DIVMOD_EXCEPTION_FLAGS := -fasynchronous-unwind-tables


I do think we should have -fno-asynchronous-unwind-tables by default for
crtstuff (and -fno-unwind-tables).

[Bug ipa/79874] symtab_node::verify_base: replace error with internal_error

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug c++/101715] compiler ice when uses a GCC cross compiler to canadian compile LLVM libc++

2021-08-01 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101715

--- Comment #2 from cqwrteur  ---
(In reply to Andrew Pinski from comment #1)
> Can you attach the preprocessed source?  It is most likely a known issue
> which we just don't hit in our libstdc++.

No problem

[Bug c++/101715] compiler ice when uses a GCC cross compiler to canadian compile LLVM libc++

2021-08-01 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101715

--- Comment #3 from cqwrteur  ---
Created attachment 51237
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51237&action=edit
Proeprocess.txt

Preprocess file.

command.txt contains my compilation toggles and error messages.
preprocess.txt is the process file

[Bug middle-end/14708] description of -ffloat-store in gcc man page incorrect/inaccurate

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

--- Comment #9 from Vincent Lefèvre  ---
An update after all these years: As Joseph S. Myers said in the gcc-help list
in February 2005, "even -ffloat-store only deals with assignment, not casts":
https://gcc.gnu.org/pipermail/gcc-help/2005-February/051031.html

So, -ffloat-store did not really help to solve the issue, though those aware of
it could replace casts by intermediate variables to ensure a conversion to the
target precision with -ffloat-store. Rather ugly.

Since then, the -fexcess-precision option has been added[*] for GCC 4.5 and
should probably be recommended as a replacement for -ffloat-store. Or is there
still any reason to use -ffloat-store?

[*] PR323 comment 123 by Joseph S. Myers (November 2008).

[Bug middle-end/78103] Failure to optimize with __builtin_clzl

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

--- Comment #24 from CVS Commits  ---
The master branch has been updated by H.J. Lu :

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

commit r12-2656-g6f0c43e97825ee54e3779afbedcd0def12443001
Author: H.J. Lu 
Date:   Sun Aug 1 09:55:33 2021 -0700

i386: Improve SImode constant - __builtin_clzll for -mno-lzcnt

Add a zero_extend patten for bsr_rex64_1 and use it to split SImode
constant - __builtin_clzll to avoid unncessary zero_extend.

gcc/

PR target/78103
* config/i386/i386.md (bsr_rex64_1_zext): New.
(combine splitter for constant - clzll): Replace gen_bsr_rex64_1
with gen_bsr_rex64_1_zext.

gcc/testsuite/

PR target/78103
* gcc.target/i386/pr78103-2.c: Also scan incl.
* gcc.target/i386/pr78103-3.c: Scan leal|addl|incl for x32.  Also
scan incq.

[Bug c++/101715] compiler ice when uses a GCC cross compiler to canadian compile LLVM libc++

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #4 from Andrew Pinski  ---
I can reproduce the ICE on x86_64-linux-gnu with a slight modification to the
preprocessed source (changing size_t to be unsigned long).

[Bug c++/101715] compiler ice when uses a GCC cross compiler to canadian compile LLVM libc++

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

--- Comment #5 from Andrew Pinski  ---
Reduced testcase:
template  struct {};
template
struct   
{
& yyy(&& __str) noexcept((::value));
& assign(&& __str) noexcept((::value));
};
template  & ::yyy(&& __str)
noexcept((::value)) {}

[Bug c++/101715] [11/12 Regression] compiler ice when uses a GCC cross compiler to canadian compile LLVM libc++

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

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-01
Summary|compiler ice when uses a|[11/12 Regression] compiler
   |GCC cross compiler to   |ice when uses a GCC cross
   |canadian compile LLVM   |compiler to canadian
   |libc++  |compile LLVM libc++
  Known to work||11.1.0
  Known to fail||11.2.0, 12.0

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

[Bug c++/24847] Instantiates un-called copy constructor

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

--- Comment #4 from Andrew Pinski  ---
these compiler reject this code:
GCC
MSVC
ICC

Only clang accepts the code.

All of the ones which reject it, all say the constructor is a copy constructor.

[Bug c++/19502] duplicate diagnostic for invalid template constant parameter

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

--- Comment #3 from Andrew Pinski  ---
Since GCC 8, we produce the error message 3 times rather than the 2 times.

[Bug c++/33821] function with ambiguous covariant return-type is not rejected

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2008-01-13 02:49:14 |2021-8-1

--- Comment #2 from Andrew Pinski  ---
Clang accepts this code too but both MSVC and ICC reject it.

[Bug c++/40177] ADL with non-unqualified-id

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

--- Comment #2 from Andrew Pinski  ---
GCC accept the original testcase now in C++20 mode since GCC 9+ and reject it
in C++98, C++11, C++14, and C++17 modes.
Clang also rejects it in < C++20 but with a decent error message:
:2:14: error: use of function template name with no prior declaration
in function call with explicit template arguments is a C++20 extension
[-Werror,-Wc++20-extensions]


The following testcase:
template  void f(T, T);
namespace P {
struct A { template friend void f(A) { } }; 
}
int main() { f<1>(P::A()); }

Has been accepted since at least GCC 4.4.7.

So is this bug fixed?

[Bug c++/101715] [11/12 Regression] ICE with noexcept and canonical types differ for identical types caused by r12-1824

2021-08-01 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101715

H.J. Lu  changed:

   What|Removed |Added

Summary|[11/12 Regression] ICE with |[11/12 Regression] ICE with
   |noexcept and canonical  |noexcept and canonical
   |types differ for identical  |types differ for identical
   |types   |types caused by r12-1824
 CC||pinskia at gcc dot gnu.org

--- Comment #7 from H.J. Lu  ---
It is caused by r12-1824.

[Bug c++/55385] g++ failed to call final overrider of a virtual function.

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #2 from Andrew Pinski  ---
This is an exact dup of bug 11750 which has been fixed since GCC 4.8; in fact a
few days before this bug was filed, Nov 14, 2012 :).

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

[Bug c++/11750] class scope using-declaration lookup not implemented

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||meng at g dot clemson.edu

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

[Bug c++/101717] New: ICE capturing static member by ref within stateless lambda

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

Bug ID: 101717
   Summary: ICE capturing static member by ref within stateless
lambda
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: johelegp at gmail dot com
CC: johelegp at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/z4d4qhx8j.
```C++
struct x {
  static void f() noexcept { }
  void (*_)() = [] { [&](auto) { f(); }(0); };
};
```

[Bug c++/101717] ICE capturing static member within stateless generic lambda

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

Johel Ernesto Guerrero Peña  changed:

   What|Removed |Added

Summary|ICE capturing static member |ICE capturing static member
   |by ref within stateless |within stateless generic
   |lambda  |lambda

--- Comment #1 from Johel Ernesto Guerrero Peña  ---
A bit simpler and a clarification: capturing at all within a generic stateless
lambda. https://godbolt.org/z/q11fT7MM8.
```C++
struct x {
  static void f() { }
  void (*_)() = [] { [=](auto) { f(); }(0); };
};
```

[Bug c++/55962] improper location for static_assert

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 9 by the patch which fixed PR 87386. There are already some
testcases which seems to match this one too.

[Bug c++/57392] The result of a .* expression is rvalue in a function template when its object expression is lvalue.

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 4.8.4, 4.9.1 and 5+ by the patch which fixed PR 61500.

[Bug c++/57311] Conversion operator can be overloaded with itself by using typedef

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 8, I suspect by r8-2669 or r8-2664.

[Bug c++/57063] static_cast from data member to rvalue reference sometimes wrongfully produces lvalue

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid

--- Comment #7 from Andrew Pinski  ---
Seems fixed in GCC 5.4 and GCC 6+.

[Bug c++/36183] misleading error message with explicit copy constructor call

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||diagnostic
   Last reconfirmed|2014-05-30 00:00:00 |2021-8-1
   Severity|normal  |enhancement

[Bug c++/61103] False-positive, template-independent name taken as dependent name

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

--- Comment #2 from Andrew Pinski  ---
Seems fixed since GCC 7+.

[Bug c++/101715] [11/12 Regression] ICE with noexcept and canonical types differ for identical types caused by r12-1824

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

--- Comment #8 from Andrew Pinski  ---
(In reply to H.J. Lu from comment #7)
> It is caused by r12-1824.

It can't be as it was not backported to GCC 11.

[Bug c++/58089] expanding empty parameter pack as constructor arguments requires accessible copy constructor

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||7.0

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

[Bug c++/62274] [C++11] Variadic templates expansion into non-variadic class template

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

--- Comment #6 from Andrew Pinski  ---
GCC, clang and MSVC all reject it with a similar error message.
ICC accepts it.

[Bug c++/35167] problem with function address constant non-type template parameter in template

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||8.1.0

--- Comment #11 from Andrew Pinski  ---
This seems fixed in GCC 8+ (yes testing with -std=c++98).

[Bug c++/52962] Column number incorrect in error

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
Fixed in GCC 7+ by r7-4797.

[Bug c++/59173] [10/11 Regression] Alias template in partial specialization finds name from primary template

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |10.4
  Known to fail||10.1.0, 4.8.5
Summary|Alias template in partial   |[10/11 Regression] Alias
   |specialization finds name   |template in partial
   |from primary template   |specialization finds name
   ||from primary template
  Known to work||4.9.0, 7.5.0, 9.3.0, 9.4.0

--- Comment #5 from Andrew Pinski  ---
So this was fixed in 4.9 and then broke again in GCC 10 so it is a regression.

[Bug c++/63609] [C++11] Partial ordering of function templates broken

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

--- Comment #3 from Andrew Pinski  ---
This is interesting.
GCC and MSVC reject it with the same ambiguous message.
clang and ICC accept it but clang prints 1 while ICC prints 2.

[Bug c++/57678] too many errors for bad template parameter

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2015-09-08 00:00:00 |2021-8-1

--- Comment #2 from Andrew Pinski  ---
Clang and ICC produce one error message.
GCC and MSVC produce two error messages.

[Bug c++/67426] Ambiguous overload between different function templates, where one has non-deduced arg

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid

--- Comment #1 from Andrew Pinski  ---
GCC, clang and ICC all reject this code.
MSVC accepts it.

[Bug target/100952] [12 regression] several test case failures after r12-1202

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

--- Comment #11 from CVS Commits  ---
The releases/gcc-11 branch has been updated by HaoChen Gui
:

https://gcc.gnu.org/g:960135b264a7724cf9c56acb6d85fb2d842a36e2

commit r11-8824-g960135b264a7724cf9c56acb6d85fb2d842a36e2
Author: Haochen Gui 
Date:   Mon Aug 2 11:14:15 2021 +0800

Fix execution failure of parity_1.f90 on P10 [PR100952]

gcc/
PR target/100952
* config/rs6000/rs6000.md (cstore4): Fix wrong fall through.

(cherry picked from commit 3382846558e02044598556e66e5ea1cb3115429d)

[Bug c++/57746] Invalid specializations of member objects are accepted, unlike member functions

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

--- Comment #9 from Andrew Pinski  ---
GCC and clang reject the code.
ICC and MSVC accepts the code.

[Bug c++/71982] Wrong error and note range with macro

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

--- Comment #1 from Andrew Pinski  ---
Seems fixed in GCC 11+.

[Bug preprocessor/60744] poor location and error recovery for unterminated argument list invoking macro

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

--- Comment #1 from Andrew Pinski  ---
GCC's tokenizer does not eat the token for DEBUG and inserts it still.  maybe
eating it is the way to fix this.

[Bug preprocessor/52998] different macro unwinder for C and C++ (-ftrack-macro-expansion)

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

--- Comment #6 from Andrew Pinski  ---
C++ and C match up in GCC 6+.

[Bug c++/56427] [C++11] template template parameter template parameter pack that depends on another parameter pack

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2013-07-25 00:00:00 |2021-8-1

--- Comment #7 from Andrew Pinski  ---
GCC, ICC and MSVC all rejects this.
Clang accepts this.

[Bug c++/72756] Using an enum as a constant expression via dot operator should not compile.

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

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=79083
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Keywords||accepts-invalid
   Last reconfirmed||2021-08-02

--- Comment #3 from Andrew Pinski  ---
Here is the full testcase (since it needs tested at instantation time):
#include 
template struct A{};

template
struct tst
{   enum : size_t { m= n % 15 };

template
void
call( tst const &t2 ) {
A  a; // 1
}
};


int main(void)
{
tst<0> t;
tst<1> t1;
t.call(t1);
}

-- CUT 

Confirmed.  Also related to PR 79083.

Note:
GCC, ICC and MSVC all accept the code
clang rejects the code.

Note they all accept the code without doing an instantation of the function
though.

[Bug c++/65152] Several friend function definitions break lookup

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
Fixed in GCC 6+.

[Bug c++/77474] sizeof and function template don't work properly together

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

[Bug c++/64178] rejects-valid on variadic operator++

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

--- Comment #1 from Andrew Pinski  ---
This is a bad interaction with an old extension really; one which I thought was
talking about removing.

[Bug c++/62274] [C++11] Variadic templates expansion into non-variadic class template

2021-08-01 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62274

Ville Voutilainen  changed:

   What|Removed |Added

 CC||jason at redhat dot com

--- Comment #7 from Ville Voutilainen  ---
I think this may be subject to various Core discussions. Jason?

[Bug c++/52985] Postincrement not applied after indexing ternary array expression

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2012-04-16 00:00:00 |2021-8-1

--- Comment #4 from Andrew Pinski  ---
< >::operator* (&TARGET_EXPR  >::operator++ (&it,
0)>)];
}
  else
{
  (void) tableB[(int) *__gnu_cxx::__normal_iterator >::operator* (&TARGET_EXPR  >::operator++ (&it,
0)>)];
} >;

This is totally bogus.  Basically we did:
(flag ? tableA[*it++] : tableB[*it++]);

But then only the *it++ in one of the branches because we only copied the tree
and do a deap copy.

[Bug c++/80679] call of overloaded is ambiguous

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2017-05-08 00:00:00 |2021-8-1
   Keywords||ice-on-valid-code

--- Comment #1 from Andrew Pinski  ---
The trunk ICEs.

[Bug c++/80368] g++ thinks sizeof a non-type template parameter is dependent

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

--- Comment #1 from Andrew Pinski  ---
Seems fixed in GCC 9+.

[Bug tree-optimization/81972] Improve data tracking for simple conditional code

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |tree-optimization
   Severity|normal  |enhancement
   Keywords||missed-optimization

--- Comment #1 from Andrew Pinski  ---
There is another bug about this specific thing.  Basically we need to sink the
function call.

[Bug c++/84030] Name lookup in presence of namespace

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2018-01-26 00:00:00 |2021-8-1
   Keywords||wrong-code

--- Comment #2 from Andrew Pinski  ---
You can also say you can get wrong code if ::A_ contains g() which returns
non-3.

[Bug c++/84196] invalid call to a function template with a vector argument silently accepted

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||10.0

--- Comment #3 from Andrew Pinski  ---
Seems fixed in GCC 10+

[Bug c++/84984] ICE: in build2, at tree.c:4686

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

--- Comment #2 from Andrew Pinski  ---
Seems fixed even in GCC 8.1.0

[Bug c++/85087] call to a non-const member function on a const lvalue accepted

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2018-03-28 00:00:00 |2021-8-1

--- Comment #2 from Andrew Pinski  ---
clang, gcc, and msvc all accepts this
ICC rejects this.

[Bug c++/29332] default argument access checking is not done at the point where the default argument expression appears

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #7 from Andrew Pinski  ---
Fixed in GCC 4.8.0 by r0-118020.

g++.dg/overload/defarg6.C is similar but not exactly the same.

[Bug c++/51257] Template changes scope of friend functions

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||5.1.0, 6.1.0, 7.1.0, 9.1.0
  Known to fail||4.9.4
   Target Milestone|--- |5.0

[Bug c++/51257] Template changes scope of friend functions

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 5+ but the correct fix went in for GCC 6 via PR 59366.

[Bug c++/59366] A friend function template defined in a class is found without ADL

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |6.0

  1   2   >