[Bug c++/101767] [10/11/12 Regression] Aggregate initialization fails for struct that has both unnamed struct and union fields

2021-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101767

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug fortran/101760] [11/12 Regression] ICE in make_ssa_name_fn, at tree-ssanames.c:290 since r12-1319-gd4d38135b3137f1d

2021-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101760

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.3

[Bug tree-optimization/101754] Missed fold for a/b*b

2021-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101754

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Keywords||missed-optimization
   Last reconfirmed||2021-08-04
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.

[Bug c++/90925] gcc allows calling private overridden operators

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #7 from Andrew Pinski  ---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55361#c5 I suspect applies here.

[Bug tree-optimization/101756] [12 Regression] ICE: verify_gimple failed (error: non-trivial conversion in 'ssa_name')

2021-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101756

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |12.0

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

[Bug tree-optimization/101750] [12 regression] g++.dg/vect/pr99149.cc fails on aarch64 since r12-2523

2021-08-03 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101750

--- Comment #3 from rguenther at suse dot de  ---
On Tue, 3 Aug 2021, tnfchris at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101750
> 
> --- Comment #2 from Tamar Christina  ---
> (In reply to Richard Biener from comment #1)
> > On x86_64 the testcase is optimized to the following now:
> > not sure how we conclude that 'n' is not written to anywhere.  The issue
> > persists even when I rename 'main' to 'foo' (when it's 'main' we could 
> > indeed
> > conclude so).
> 
> I think it's because it's concluding that the access of `h` must trap since 
> `h`
> is local and uninitialized.

Hmm, but 'h' is a member of the class object 'n' which is global.

> That also explains the abort. Looks like the reducer needs some slight
> adjustment. if I declare `h` static then it works again.

[Bug c++/48078] accepts-invalid: taking address of private member function from template function

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||awise.gcc.bug at gmail dot com

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

[Bug c++/70984] Templated derived class erroneously allows taking address of private base class member functions

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
This is a dup of bug 48078 which seems fixed in GCC 11+.

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

[Bug c++/48078] accepts-invalid: taking address of private member function from template function

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #7 from Andrew Pinski  ---
This seems fixed in GCC 11+, maybe by the patch which fixed PR 41437.

[Bug c++/53116] protected member access from derived template

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||accepts-invalid

--- Comment #5 from Andrew Pinski  ---
GCC, ICC and MSVC all accept this code.
clang rejects it.

[Bug c++/35383] Lookup of template dependent function with overloads fails for namespace-qualified parameter

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
I think GCC trunk does the correct for the first testcase.
ADL only finds functions in the same namespace as the arguments types; that is
why:
// move this line inside namespace Foo, and all is OK

Works.

as for func, GCC 4.7+ gets it correct and rejects the code for Fred.

So all invalid/fixed.

(In reply to ophir.setter+gcc from comment #2)
> Is the following the same bug as this bug?

It is the same accepts-invalid bug that is similar to func2 in the original
testcase.

[Bug c++/65969] typename allowed in using declaration of non-types names

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

--- Comment #5 from jim x  ---
The last two cases seem to be not a bug to me. The standard says(cite the c++20
standard)

> If a using-declarator uses the keyword typename and specifies a dependent 
> name ([temp.dep]), the name introduced by the using-declaration is treated as 
> a typedef-name. 

In these cases, regardless of `g`, `f` or even `var`; they are not **dependent
name**, hence the keyword `typename` has no effect on them(i.e., they were not
considered as typedef-name). they didn't violate any rule.

[Bug c++/72708] error on anonymous union in an unnamed namespace

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

--- Comment #5 from Andrew Pinski  ---
This code is accepted:
namespace {
  static union { int x; };
}

---
For the original testcase, only clang accepts the code; ICC, GCC and MSVC all
reject the code with the similar error message saying:
GCC:
:3:18: error: namespace-scope anonymous aggregates must be static

ICC:
(3): error: anonymous union at global or namespace scope must be
declared static

MSVC:
(3): error C2646: an anonymous union at global or namespace scope must
be declared static

--- CUT -

[Bug c++/92034] extern template declarations cannot have internal linkage (unnamed namespace)

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

--- Comment #5 from Andrew Pinski  ---
Only clang errors out.
ICC, GCC and MSVC all accept the code.

[Bug tree-optimization/95384] Poor codegen cause by using base class instead of member for Optional construction

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Confirmed.
All bad around.  I wonder if we could "expose" some of the details of the ABI
late in gimple to simplify/solve this.

[Bug tree-optimization/95384] Poor codegen cause by using base class instead of member for Optional construction

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

Andrew Pinski  changed:

   What|Removed |Added

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

[Bug c++/84832] Base class member function incorrectly introduced by using-declarator

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

--- Comment #2 from Andrew Pinski  ---
Note GCC and ICC accept the code.
While clang and MSVC reject the code.

[Bug c++/86249] declaration conflicts with target of using declaration already in scope

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

--- Comment #2 from Andrew Pinski  ---
Interesting, GCC, ICC and MSVC all accept this.

[Bug c++/85251] Using declaration for base class constructor looses explicit.

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

--- Comment #1 from Andrew Pinski  ---
GCC, ICC, and MSVC all do the same thing and calls A(int).

[Bug c++/80577] Avoid using adj in member function pointers

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
What is being mentioned here is that mfp.__delta will always be 0 as we know
foo has no base classes and f is an exact type of foo and using it as foo type.

  _1 = mfp.__delta;
  _2 = (sizetype) _1;
  _3 =  + _2;


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101603
[Bug 101603] [meta-bug] pointer to member functions issues

[Bug c++/80288] Using directive injects names into a wrong namespace

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

--- Comment #1 from Andrew Pinski  ---
Interesting,
ICC, GCC and MSVC all reject this with being ambiguous.
Only clang accepts it.

[Bug c++/50921] GCC cannot find dependent conversion-function-id even if there's a using declaration for it

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid
  Known to fail||11.1.0
 Status|ASSIGNED|NEW
   Last reconfirmed|2012-08-31 00:00:00 |2021-8-3
   Assignee|fabien at gcc dot gnu.org  |unassigned at gcc dot 
gnu.org

--- Comment #5 from Andrew Pinski  ---
So it seems like it is only the conversion operators and only if explicitly
called.

[Bug c++/66159] bogus warning for alias-declaration using elaborated-type-specifier

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||rutsky.vladimir at gmail dot 
com

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

[Bug c++/64259] Erroneous "declaration 'struct ...' does not declare anything" when using "typename"

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Dup of bug 66159 which is fixed in GCC 11+.

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

[Bug c++/95597] GCC rejects "typename" in using-declaration

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

--- Comment #1 from Andrew Pinski  ---
here is another testcase:
typedef int T;
namespace y{
using typename ::T;
}

[Bug c++/94159] parse error on a declaration of a dependent class using a class-key instead of typename

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

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-08-04
 Status|UNCONFIRMED |NEW
  Known to fail||4.1.2

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

[Bug c++/65969] typename allowed in using declaration of non-types names

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||xmh970252187 at gmail dot com

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

[Bug c++/101771] The keyword "typename" is illegal used in a using-declaration that introduces the non-type declarations

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This is a dup of bug 65969.

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

[Bug c++/101771] New: The keyword "typename" is illegal used in a using-declaration that introduces the non-type declarations

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

Bug ID: 101771
   Summary: The keyword "typename" is illegal used in a
using-declaration that introduces the non-type
declarations
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xmh970252187 at gmail dot com
  Target Milestone: ---

struct C{
void fun(){}
};
template
struct D:T{
using typename T::fun;  // #1
};
int main(){
D b;  
}

According to [temp.res#general-5] 

>A qualified-id whose terminal name is dependent and that is in a type-only 
>context is considered to denote a type. A name that refers to a 
>using-declarator whose terminal name is dependent is interpreted as a 
>typedef-name if the using-declarator uses the keyword typename.

`fun` in #1 is interpreted to a typedef-name

Meanwhile, according to [temp.res#general-6.5]
> The validity of a template may be checked prior to any instantiation. The 
> program is ill-formed, no diagnostic required, if:

>> the interpretation of such a construct in the hypothetical instantiation is 
>> different from the interpretation of the corresponding construct in any 
>> actual instantiation of the template.  

The actual instantiation of `D` would make `fun` denotes a function rather
than denotes a type. Hence, it should be illegal.

[Bug tree-optimization/101770] New: -Wmaybe-uninitialized false alarm with only locals in GNU diffutils

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

Bug ID: 101770
   Summary: -Wmaybe-uninitialized false alarm with only locals in
GNU diffutils
   Product: gcc
   Version: 11.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: eggert at cs dot ucla.edu
  Target Milestone: ---

Created attachment 51256
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51256=edit
False alarm with gcc -O2 -Wmaybe-uninitialized and only locals

I found this problem while compiling sdiff.c from GNU diffutils. The attached
is is a simplified version. It appears to be distinct from GCC bug 101768 since
it involves only local variables.

Compile it this way:

gcc -O2 -Wmaybe-uninitialized -S w.i

The output is:

w.i: In function ‘edit’:
w.i:50:18: warning: ‘cmd1’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   50 |   return !cmd1;
  |  ^

This is a false alarm, because line 50 can be reached only if cmd0=='e', and if
cmd0=='e' then  the previous switch statement (inside the while loop - line 27)
guarantees that cmd1 has been initialized.

I briefly tried to simplify the example further, but failed. For example, if I
remove line 16 ("case '2':") the false alarm goes away.

This is with gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1) on x86-64.

[Bug tree-optimization/94274] fold phi whose incoming args are defined from binary operations

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #6 from Andrew Pinski  ---
Mine. There is another bug which I assigned to myself which is very similar.

[Bug tree-optimization/96336] Multiple multiplications fail to optimize

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/94884] Failure to recognize that result of or is always superior to operands

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

Andrew Pinski  changed:

   What|Removed |Added

 Depends on||101590

--- Comment #5 from Andrew Pinski  ---
The comment #4 is recorded in PR 101590, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101590#c2.
So I will double check this when I go implement that one fully.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101590
[Bug 101590] (len & - N) <= len is not optimized to 1

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

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

--- Comment #5 from Steven Sun  ---
(In reply to Andrew Pinski from comment #4)
Thanks!


(In reply to myself from comment #3)

> The program seems never think of a situation "a lambda inside a lambda
> inside a NSDMI`. We need to amend the logic here.


edit to:

The program seems never think of a situation "member function call inside a
generic lambda inside a lambda inside a NSDMI`. We need to amend the logic
here.


-

The direct cause of failure is in g:91e534b0d

```
if (!containing_function && !COMPLETE_TYPE_P (closure))
/* If we're parsing a lambda in a non-local class,
   we can find the fake 'this' in scope_chain.  */
init = scope_chain->x_current_class_ptr;
```

This part of logic is to find the potential `this` since there is a (static)
member function call `f`. Refer to the following comments:

  /* For the overload resolution we need to find the actual `this`
 that would be captured if the call turns out to be to a
 non-static member function.  Do not actually capture it at this
 point.  */


// in function `build_new_method_call_1` in `gcc/cp/call.c`

-

As for example in comment 1:


`scope_chain->x_current_class_ptr` is correctly set when parsing 

```
[=](auto) { f(); }
```

But it was soon incorrectly set when instantiating the same lambda, i.e.
parsing

```
[=](auto) { f(); }()
``` 


This failure only affectes the potential `this` pointer inside the

```
[=](auto) { f(); }
```

But since here needs no `this` pointer, deleting that problematical
`gcc_checking_assert` is actually a potential fix for this problem.

[Bug tree-optimization/94884] Failure to recognize that result of or is always superior to operands

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/94884] Failure to recognize that result of or is always superior to operands

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

--- Comment #4 from Andrew Pinski  ---
Part of this is:

bool f1_part0(unsigned x, unsigned y)
{
unsigned t1 = x;
unsigned t = (x | y);
return t >= t1;
}

Should be optimized to true.

[Bug tree-optimization/94793] Failure to optimize clz idiom

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

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

[Bug tree-optimization/99887] Failure to optimize log2 pattern to clz

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
This is the same as PR 94793 really.

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

[Bug tree-optimization/96921] Failure to optimize combined boolean not patterns

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

--- Comment #8 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #7)
> (In reply to Andrew Pinski from comment #4)
> > Hmm,  thinking about expanding this further:
> 
> I am going to handle the non-special (bool) case as PR 101610.

Actually PR 91213.

[Bug tree-optimization/91213] Missed optimization: (sub X Y) -> (xor X Y) when Y <= X and isPowerOf2(X + 1)

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

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

[Bug tree-optimization/101610] CST - (x ^ (CST-1)) can be optimized to x + 1 if x < CST and CST is a power of 2

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Andrew Pinski  ---
This is basically PR 91213.

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

[Bug tree-optimization/91213] Missed optimization: (sub X Y) -> (xor X Y) when Y <= X and isPowerOf2(X + 1)

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org

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

[Bug tree-optimization/89263] Simplify bool expression to OR

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/96685] Failure to optimize not+sub to add+not

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.0

[Bug tree-optimization/94356] Missed optimisation: useless multiplication generated for pointer comparison

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

--- Comment #5 from Andrew Pinski  ---
Hmm, the following is worse:

typedef int t[10];

int f(t *p, long long o) {
t *p1 = p+o;
return p < p1;
}

[Bug middle-end/19987] [meta-bug] fold missing optimizations in general

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

Bug 96897 Summary: Failure to optimize sub+not involving constant to add
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96897

   What|Removed |Added

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

[Bug tree-optimization/96897] Failure to optimize sub+not involving constant to add

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
Fixed with r11-5958.

[Bug tree-optimization/96897] Failure to optimize sub+not involving constant to add

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

Bug 37516 Summary: ~(-2 - a) is not being optimized into a + 1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37516

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |DUPLICATE

[Bug tree-optimization/96685] Failure to optimize not+sub to add+not

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org

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

[Bug rtl-optimization/37516] ~(-2 - a) is not being optimized into a + 1

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
 Resolution|--- |DUPLICATE
 Status|ASSIGNED|RESOLVED

--- Comment #8 from Andrew Pinski  ---
Fixed with r11-5958.

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

[Bug c/101766] Microblaze gcc misses symver but __has_attribute(symver) returns true

2021-08-03 Thread giulio.benetti at benettiengineering dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766

--- Comment #3 from Giulio Benetti  ---
I've done this:
https://github.com/libfuse/libfuse/pull/620/commits/3aba09a5c56e017746c5c1652dbc845f4db7374a

and works fine. It doesn't seem to have pitfalls.

[Bug tree-optimization/96897] Failure to optimize sub+not involving constant to add

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

Andrew Pinski  changed:

   What|Removed |Added

 Depends on||37516
   Assignee|prathamesh3492 at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org

--- Comment #3 from Andrew Pinski  ---
MIne because this is basically PR 37516.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37516
[Bug 37516] ~(-2 - a) is not being optimized into a + 1

[Bug tree-optimization/96897] Failure to optimize sub+not involving constant to add

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

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

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

--- Comment #4 from Andrew Pinski  ---
(In reply to Steven Sun from comment #3)
> By the way, does anyone know other magics like g:hash?

r works for the old Subversion revisions
"PR" and "bug " (maybe one more) puts a link to the other bug.
rN- (and rN--H) works if you know the new scheme of git revisions
(git gcc-descr can find that for you and you can undo them with gcc-undescr)

I think those are all of the ones which we added to bugzilla, everything else
is standard (e.g. comment #0 works).

[Bug tree-optimization/99997] Missed optimisation with -Os

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

Andrew Pinski  changed:

   What|Removed |Added

   Assignee|rguenth at gcc dot gnu.org |pinskia at gcc dot 
gnu.org

--- Comment #3 from Andrew Pinski  ---
Hmm,  phi-opt should have done it:

  if (_10 != 0)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 536870913]:
  _3 = page_2(D)->compound_head;
  _4 = (_Bool) _3;
  _11 = (int) _4;

   [local count: 1073741824]:
  # iftmp.0_5 = PHI <1(2), _11(3)>

We have code to move the conversion in phiopt but we are not doing it for some
reason:
Take:
bool f(int tf, long unsigned int r)
{
  int t = 1;
  if (tf)
t = ((r&1)!=0);
  return t;
}
bool f2(int tf, long unsigned int r)
{
  int t = 1;
  bool tt = ((r&1)!=0);
  if (tf)
t = tt;
  return t;
}
These two functions should produce 100% the same code but they don't.
Mine.

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

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

Steven Sun  changed:

   What|Removed |Added

 CC||StevenSun2021 at hotmail dot 
com

--- Comment #3 from Steven Sun  ---
This bug is not introduced in GCC 12.

The relevant code fragment is last edited by g:91e534b0d


in `gcc/cp/lambda.c`
```
gcc_checking_assert
(init && (TREE_TYPE (TREE_TYPE (init))
== current_nonlambda_class_type ()));

```

The assertion fails since long ago. (init == 0 in this case)

Before GCC 12, the `gcc_checking_assert` is `(void)0` in release version,
leaving everything fine. Somehow `gcc_checking_assert` starts working now, and
aborts the program.


My insight on the problem:
The program seems never think of a situation "a lambda inside a lambda inside a
NSDMI`. We need to amend the logic here.

"here" means
https://gcc.gnu.org/git?p=gcc.git;a=blob;f=gcc/cp/lambda.c;h=2e9d38bbe832702804ddcaffc4024ce930a74843;hb=refs/heads/master#l755

By the way, does anyone know other magics like g:hash?

[Bug tree-optimization/95527] Failure to optimize __builtin_ffs == 0

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/101769] New: loop->finite_p is not always true for some loops even with -ffinite-loops being used

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

Bug ID: 101769
   Summary: loop->finite_p is not always true for some loops even
with -ffinite-loops being used
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take the following C++ testcase:
struct Node
{
Node*   right;
Node*   down;
};

inline
void free_node(Node*)
{
}

void free_all(Node* n_)
{
if (n_ == nullptr) {
return;
}
free_all(n_->right);
do {
Node* t = n_->down;
free_node(n_);
n_ = t;
} while (n_);
}

void free_all2_r(Node* n_)
{
if (n_->right) {
free_all2_r(n_->right);
}
do {
Node* t = n_->down;
free_node(n_);
n_ = t;
} while (n_);
}

void free_all2(Node* n_)
{
if (n_) {
free_all2_r(n_);
}
}

void loop(Node* n_)
{
do {
n_ = n_->down;
} while (n_);
}

int main()
{
return 0;
}
 CUT -
These all should be empty functions at -O2 -ffinite-loops but currently
free_all, free_all2_r, and free_all2 produce empty loops around the element.

loop is able to do the right thing.
What seems to be happening is loop->finite_p being lost somewhere.

[Bug middle-end/100810] [12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776

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

--- Comment #7 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #6)
> GCC does warn about an unitialized variable i even in "i && d"
> For:
> if (!b)
>   i &
> 
> b is even set to 1.  Note setting b to be 0 still get the wrong code.

The bug is IV-OPTS which selects a variable which is based on an unintialized
value.
CCP is not the problem, it was just happen to find that h_lsm.23_29 is based on
an unintialized value and props the undefinedness forward.

[Bug middle-end/100810] [12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776

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

--- Comment #6 from Andrew Pinski  ---
GCC does warn about an unitialized variable i even in "i && d"
For:
if (!b)
  i &

b is even set to 1.  Note setting b to be 0 still get the wrong code.

[Bug gcov-profile/71672] inlining indirect calls does not work with autofdo

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

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Eugene Rozenfeld :

https://gcc.gnu.org/g:285aa6895d479bed8e72ad363290846645b6faa0

commit r12-2711-g285aa6895d479bed8e72ad363290846645b6faa0
Author: Eugene Rozenfeld 
Date:   Mon Aug 2 18:36:09 2021 -0700

Fix indirect call inlining with AutoFDO

The histogram value for indirect calls was incorrectly set up.
That is fixed now.

With this change the tree-prof tests checking indirect call inlining with
AutoFDO
in gcc.dg and g++.dg are passing.

Resolves:
PR gcov-profile/71672 - inlining indirect calls does not work with autofdo

gcc/ChangeLog:
PR gcov-profile/71672
* auto-profile.c (afdo_indirect_call): Fix setup of the historgram
value for indirect calls.

[Bug gcov-profile/71672] inlining indirect calls does not work with autofdo

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

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Eugene Rozenfeld :

https://gcc.gnu.org/g:9265b378531391498ec1727f67a45da72a6c07e9

commit r12-2710-g9265b378531391498ec1727f67a45da72a6c07e9
Author: Eugene Rozenfeld 
Date:   Mon Aug 2 18:29:24 2021 -0700

Fixes for AutoFDO testing

* create_gcov tool doesn't currently support dwarf 5 so I made a change in
profopt.exp
  to pass -gdwarf-4 when compiling the binary to profile.

* I updated the invocation of create_gcov in profopt.exp to pass
-gcov_version=2.
  I recently made a change to create_gcov to support version 2:
  https://github.com/google/autofdo/pull/117 .

* I removed useless -o perf.data from the invocation of gcc-auto-profile in
  target-supports.exp.

These changes contribute to fixing PR gcov-profile/71672.

gcc/testsuite/ChangeLog:

* lib/profopt.exp: Pass gdwarf-4 when compiling test to profile;
pass -gcov_version=2.
* lib/target-supports.exp: Remove unnecessary -o perf.data passed
to gcc-auto-profile.

[Bug gcov-profile/71672] inlining indirect calls does not work with autofdo

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

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Eugene Rozenfeld :

https://gcc.gnu.org/g:0ed093c7c3f755bc1cd80e5186abeb2f5c50ee0c

commit r12-2709-g0ed093c7c3f755bc1cd80e5186abeb2f5c50ee0c
Author: Eugene Rozenfeld 
Date:   Mon Aug 2 17:22:34 2021 -0700

Fix indir-call-prof-2.c with AutoFDO

indir-call-prof-2.c has -fno-early-inlining but AutoFDO can't work without
early inlining (it needs to match the inlining of the profiled binary).
I changed profopt.exp to always pass -fearly-inlining for AutoFDO.
With that change the indirect call inlining in indir-call-prof-2.c happens
in the early inliner
so I changed the dg-final-use-autofdo.

Contributes to fixing PR gcov-profile/71672

gcc/testsuite/ChangeLog:

* gcc.dg/tree-prof/indir-call-prof-2.c: Fix dg-final-use-autofdo.
* lib/profopt.exp: Pass -fearly-inlining when compiling with
AutoFDO.

[Bug gcov-profile/71672] inlining indirect calls does not work with autofdo

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

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Eugene Rozenfeld :

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

commit r12-2708-gf9ad3d5339faaaed6e15a7b27d90fbc66eb72f37
Author: Eugene Rozenfeld 
Date:   Mon Aug 2 17:12:04 2021 -0700

Fixes for AutoFDO tests

* Changed several tests to use -fdump-ipa-afdo-optimized instead of
-fdump-ipa-afdo
in dg-options so that the expected output can be found

* Increased the number of iterations in several tests so that perf can have
enough sampling events

Contributes to fixing PR gcov-profile/71672.

gcc/testsuite/ChangeLog:

* g++.dg/tree-prof/indir-call-prof.C: Fix options, increase the
number of iterations.
* g++.dg/tree-prof/morefunc.C: Fix options, increase the number of
iterations.
* g++.dg/tree-prof/reorder.C: Fix options, increase the number of
iterations.
* gcc.dg/tree-prof/indir-call-prof-2.c: Fix options, increase the
number of iterations.
* gcc.dg/tree-prof/indir-call-prof.c: Fix options.

[Bug middle-end/100810] [12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776

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

--- Comment #5 from Andrew Pinski  ---
  # i_16 = PHI 

  _22 = (unsigned int) i_16;
  _48 = -_22;
  _49 = _39 - _22;
  h_lsm.23_29 = (int) _49;

Somehow or another h gets its value from i which causes the incorrect code.
ccp is not at fault.

[Bug tree-optimization/82188] Missed optimization opportunity for constant folding

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

--- Comment #3 from Andrew Pinski  ---
int main (void)
{
  volatile int x = 1; 

  long t1 = 1/(2U-x);
  int t2 = 0!=(((int)(2%(2+t1)))/2);

  if (t1 != 1) __builtin_abort();
  if (t2 != 1) __builtin_abort();
  return 0;
}

 CUT 

  x.1_2 = (unsigned int) x.0_1;
  _3 = 2 - x.1_2;
  _4 = 1 / _3;
  _12 = _3 <= 1;
  _8 = (long int) _12;
  _6 = _8 << 1;
  if (_4 != 1)
...
  if (_6 != 2)

We know the range of _8 is [0, 1], so we should change _6 != 2 to _8 != 1
Which then gets simplified to _3 > 1.

As for the _4 != 1:
1/ (2-x) != 1 is always false?

[Bug c/101766] Microblaze gcc misses symver but __has_attribute(symver) returns true

2021-08-03 Thread giulio.benetti at benettiengineering dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766

--- Comment #2 from Giulio Benetti  ---
Ah ok, so the workaround is to check with a little build test, right?

[Bug c++/95016] [DR 2082] Referring to parameters in unevaluated operands of default arguments

2021-08-03 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95016

--- Comment #1 from Marek Polacek  ---
Will be fixed by
https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576627.html

[Bug tree-optimization/81206] missed tail recursion

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Full testcase:

int a;
int b(int c, int d)
{
  //int c, d;
  if (a)
d = b(c, d);
  return (1 + c) + d;
}

int b1(int c, int d)
{
 // int c, d;
  int t = (1 + c);
  if (a)
d = b1(c, d);
  return t + d;
}
Both of these should have a tail recursion but currently b1 only does.

[Bug middle-end/100810] [12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776

2021-08-03 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100810

--- Comment #4 from Roger Sayle  ---
I believe this bug occurs during the .195t.ccp4 pass that was introduced by the
commit identified above, where tree-ssa-propagate.c's
substitute_and_fold_engine appears not to correctly handle the situation of a
completely empty basic block (or the CFG flags describing it are incorrect).

Things are fine (but unusual) with the incoming GIMPLE:

   [local count: 69772953]:
  # i_30 = PHI 
  # h_lsm.23_40 = PHI 
  if (g.12_20 != 0)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 282263306]:

   [local count: 69772953]:
  # h_lsm.23_27 = PHI 
  _31 = i_30 != 0;
  _14 = _10 & _31;
  if (_14 != 0)
goto ; [25.00%]
  else
goto ; [75.00%]

Notice that the only purpose of the empty bb12 is to define the phi eddges
into bb13, one edge sets h_lsm to 2, the other doesn't.  Alas, this logic gets
overlooked by ccp4, where TDF_DETAILS reports:

Folding PHI node: h_lsm.23_40 = PHI 
No folding possible
Folding PHI node: h_lsm.23_27 = PHI 
Queued PHI for removal.  Folds to: 2
...
Removing basic block 12
;; basic block 12, loop depth 1
;;  pred:
;;  succ:   13
Merging blocks 11 and 13

And things do downhill from there. Alas I'm still trying to figure exactly how
the "Folds to: 2" is (mis)deduced, but I thought I'd share my analysis so far
so that a real tree-ssa expert can confirm what's supposed to happen.

A useful workaround for debugging is:
diff --git a/gcc/passes.def b/gcc/passes.def
index 26d86df..c2806bc 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -339,7 +339,9 @@ along with GCC; see the file COPYING3.  If not see
   /* Threading can leave many const/copy propagations in the IL.
 Clean them up.  Instead of just copy_prop, we use ccp to
 compute alignment and nonzero bits.  */
+#if 0
   NEXT_PASS (pass_ccp, true /* nonzero_p */);
+#endif
   NEXT_PASS (pass_warn_restrict);
   NEXT_PASS (pass_dse);
   NEXT_PASS (pass_cd_dce, true /* update_address_taken_p */);

Another workaround, for this particular testcase, is -fno-tree-loop-sm, but the
real culprit (as shown above) is inside pass_ccp (or in the invariants it's
relying on).

[Bug tree-optimization/81206] missed tail recursion

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

--- Comment #1 from Andrew Pinski  ---
int a;
int b()
{
  int c, d;
  if (a)
d = b();
  return 1 + c + d;
}

[Bug tree-optimization/101768] -Wmaybe-uninitialized false alarm with non local variables in some cases

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

--- Comment #3 from Andrew Pinski  ---
[AFTER NORMALIZATION -- [DEF]:
 (.NOT.) ct.0_1 == 1


[AFTER NORMALIZATION -- [DEF]:
offset_width_13 = PHI 
is guarded by :

 (.NOT.) arg_10 != 0 (.AND.) arg_16 != 0 (.AND.) ct.0_1 == 1
(.OR.)
 (.NOT.) arg_16 != 0 (.AND.) ct.0_1 == 1


[AFTER NORMALIZATION -- [USE]:
foo (offset_width_13);
is guarded by :

prephitmp_5 == 1

Uninit did not look up the chain for prephitmp_5 to see:
  # prephitmp_5 = PHI 


  foo (offset_width_13);
  pretmp_6 = ct;

[Bug tree-optimization/101768] -Wmaybe-uninitialized false alarm with non local variables in some cases

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Keywords||diagnostic
   Last reconfirmed||2021-08-03
Summary|-Wmaybe-uninitialized false |-Wmaybe-uninitialized false
   |alarm with 'switch' instead |alarm with non local
   |of 'if' |variables in some cases

--- Comment #2 from Andrew Pinski  ---
here is a reduced testcase:
int ct;
void foo (int);

int
cmp (int arg)
{
  int differing = 0;
  int offset_width;

  if (ct == 1)
{
  offset_width = 1;
  for (offset_width = 1; (arg /= 10) != 0; offset_width++)
;
}
  do {
  if (ct == 1) {
foo (offset_width);
differing--;
  }
}  while (differing <= 0);

  return !!differing;
}

GCC does not figure out once ct == 1, and foo is called, it will either become
ct == 1 which is fine or never be ct == 1 again.

[Bug tree-optimization/101768] -Wmaybe-uninitialized false alarm with 'switch' instead of 'if'

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

--- Comment #1 from Andrew Pinski  ---
switch has nothing to do it.

[Bug tree-optimization/101768] New: -Wmaybe-uninitialized false alarm with 'switch' instead of 'if'

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

Bug ID: 101768
   Summary: -Wmaybe-uninitialized false alarm with 'switch'
instead of 'if'
   Product: gcc
   Version: 11.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: eggert at cs dot ucla.edu
  Target Milestone: ---

Created attachment 51255
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51255=edit
False alarm with gcc -O2 -Wmaybe-uninitialized

The attached program is a greatly-simplified version of GNU diffutils' cmp
program. Compiling it this way:

gcc -O2 -Wmaybe-uninitialized -S u.i

causes gcc to emit the bogus diagnostic:

u.i: In function ‘cmp’:
u.i:21:11: warning: ‘offset_width’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   21 |   foo (offset_width);
  |   ^~

I tried simplifying it further (removing the 'main' function, turning the
switch into an if, etc.) but the warning went away with the further
simplifications.

This is with gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1) on x86-64.

[Bug c++/101767] [10/11/12 Regression] Aggregate initialization fails for struct that has both unnamed struct and union fields

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

Andrew Pinski  changed:

   What|Removed |Added

Summary|[11/12 Regression]  |[10/11/12 Regression]
   |Aggregate initialization|Aggregate initialization
   |fails for struct that has   |fails for struct that has
   |both unnamed struct and |both unnamed struct and
   |union fields|union fields
   Target Milestone|11.3|10.4
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=100489
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
  Known to work||10.3.0
   Last reconfirmed||2021-08-03

--- Comment #1 from Andrew Pinski  ---
So this is most likely caused by the patch which fixes PR 100489 so this is a
regression in 10.4.0 also.

[Bug c++/101767] [11/12 Regression] Aggregate initialization fails for struct that has both unnamed struct and union fields

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.3

[Bug c++/101747] Two-argument version of attribute malloc does not perform overload resolution

2021-08-03 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101747

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-03
 CC||msebor at gcc dot gnu.org
   Keywords||rejects-valid
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
I suppose the return type of the allocator could be used for the
disambiguation.  The difficulty here is that the attribute handler is in code
shared by the C and C++ front ends with no good way to call a language-specific
routine to do overload resolution.  Maybe the attribute should accept a string
with the mangled name of the function in addition to a function name.

IIRC, attribute copy has the same limitation.

[Bug c++/101767] New: Aggregate initialization fails for struct that has both unnamed struct and union fields

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

Bug ID: 101767
   Summary: Aggregate initialization fails for struct that has
both unnamed struct and union fields
   Product: gcc
   Version: 11.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xtkoba at gmail dot com
  Target Milestone: ---

Created attachment 51254
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51254=edit
Repro

$ cat unnamed_fields.cc

typedef struct {
  struct {
int x;
  };
  union {
int y;
float z;
  };
} S;

void foo(void)
{
  [[maybe_unused]] S a = {
.x = 1,
.y = 0
  };
}

$ g++-11.2.0 unnamed_fields.cc -c
unnamed_fields.cc: In function 'void foo()':
unnamed_fields.cc:17:3: error: 'S::' has no non-static data
member named 'y'
   17 |   };
  |   ^

$ g++-11.2.0 -v
Using built-in specs.
COLLECT_GCC=g++-11.2.0
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-11.2.0/work/gcc-11.2.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/11.2.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 11.2.0 p1'
--disable-esp --enable-libstdcxx-time --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-multilib
--with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all
--enable-libgomp --disable-libssp --disable-libada --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --enable-lto --without-isl --enable-default-pie
--enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (Gentoo 11.2.0 p1)

[Bug c/101766] Microblaze gcc misses symver but __has_attribute(symver) returns true

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

--- Comment #1 from Andrew Pinski  ---
__has_attribute is broken for many attributes.  If GCC supports them in a
generic way but does not really support them, __has_attribute still returns
true.

[Bug libbacktrace/101753] ld: Unrecognized argument: --build-id

2021-08-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101753

John David Anglin  changed:

   What|Removed |Added

 Target|hppa*-hp-hpux*  |hppa64-hp-hpux*
   Host|hppa*-hp-hpux*  |hppa64-hp-hpux*
  Build|hppa*-hp-hpux*  |hppa64-hp-hpux*

--- Comment #2 from John David Anglin  ---
hppa64-hp-hpux* is an ELF system but linker is HP.  This is also true for
ia64-hpux.

This is what I see for HAVE_ELF:
./hppa64-hp-hpux11.11/libbacktrace/config.log:HAVE_ELF_FALSE='#'
./hppa64-hp-hpux11.11/libbacktrace/config.log:HAVE_ELF_TRUE=''
./hppa64-hp-hpux11.11/libbacktrace/config.status:S["HAVE_ELF_FALSE"]="#"
./hppa64-hp-hpux11.11/libbacktrace/config.status:S["HAVE_ELF_TRUE"]=""
./libbacktrace/config.log:HAVE_ELF_FALSE='#'
./libbacktrace/config.log:HAVE_ELF_TRUE=''
./libbacktrace/config.status:S["HAVE_ELF_FALSE"]="#"
./libbacktrace/config.status:S["HAVE_ELF_TRUE"]=""

[Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34

2021-08-03 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101741

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Sebor  ---
I believe invalid in the keyword means strictly syntactically invalid, not
undefined as a result of a semantic constraint (e.g., defining a standard
function; GCC normally handles that gracefully).

[Bug c/101766] New: Microblaze gcc misses symver but __has_attribute(symver) returns true

2021-08-03 Thread giulio.benetti at benettiengineering dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766

Bug ID: 101766
   Summary: Microblaze gcc misses symver but
__has_attribute(symver) returns true
   Product: gcc
   Version: 10.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: giulio.benetti at benettiengineering dot com
  Target Milestone: ---

Microblaze gcc can't use .symver attribute leading to:
error: symver is only supported on ELF platforms

This is a simple test-case(taken from libfuse3) that reproduce the problem:
'''
# if !__has_attribute (symver)
# error symver attribute not supported
# endif
#else
#error __has_attribute not defined, assume we do not have symver
#endif

__attribute__ ((symver ("fuse_new@FUSE_3.0")))
void func1(void)
{

}

int main(void) {
return 0;
}

'''
The problem is the discrepancy I've found between __has_attribute(symver)
that return true, while in gcc/gcc/config.gcc 'elfos.h' is not listed under
Microblaze cases. Trying adding elfos.h to it leads to other linker problems
and this makes me think that Microblaze doesn't actually support
__ELF__(symver).
So I thought to build gcc using --disable-symvers explictly until a fix is
found, but that doesn't either work.

Can you please give help?

Thanks a lot!

[Bug tree-optimization/81127] Complex division misses BB vectorisation opportunity

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

--- Comment #2 from Andrew Pinski  ---
SLP does work for:
void f(complex double *x, complex double *y, double *tt) {
  complex double t = *x/ *y;
  tt[0] = __real__ t;
  tt[1] = __imag__ t;
}

[Bug testsuite/101688] g++.dg/warn/Wstringop-overflow-4.C fails on 32-bit archs with new jump threader

2021-08-03 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101688

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Sebor  ---
Fixed in r12-2707.

[Bug testsuite/101688] g++.dg/warn/Wstringop-overflow-4.C fails on 32-bit archs with new jump threader

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

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

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

commit r12-2707-gaabf07cd5dc314135adde89830a86be157d7596b
Author: Martin Sebor 
Date:   Tue Aug 3 13:53:02 2021 -0600

Disable a test case in ILP32 [PR101688].

Resolves:
PR testsuite/101688 - g++.dg/warn/Wstringop-overflow-4.C fails on 32-bit
archs with new jump threader

gcc/testsuite:
PR testsuite/101688
* g++.dg/warn/Wstringop-overflow-4.C: Disable a test case in ILP32.

[Bug testsuite/101688] g++.dg/warn/Wstringop-overflow-4.C fails on 32-bit archs with new jump threader

2021-08-03 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101688

Martin Sebor  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Target Milestone|--- |12.0
  Component|middle-end  |testsuite
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
   Host|x86-64 with -m32, ppc64 |i686-*-* powerpc-*-*
   |with -m32   |

[Bug c++/101765] New: ICE when using a VLA inside of a coroutine

2021-08-03 Thread kacper.slominski72 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101765

Bug ID: 101765
   Summary: ICE when using a VLA inside of a coroutine
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kacper.slominski72 at gmail dot com
  Target Milestone: ---

The following code, when compiled with "-std=c++20 -fcoroutines" (on GCC
versions starting from 10.1 and including trunk) causes an ICE:
#include 

struct dummy_coro {
using promise_type = dummy_coro;
bool await_ready() noexcept { return false; }
void await_suspend(std::coroutine_handle<>) noexcept { }
void await_resume() noexcept { }
dummy_coro get_return_object() { return {}; }
dummy_coro initial_suspend() { return {}; }
dummy_coro final_suspend() noexcept { return {}; }
void return_void() { }
void unhandled_exception() { }
};

dummy_coro foo(int arg) {
char arr[arg];
co_return;
}

Compiler output from GCC 11:
: In function 'dummy_coro foo(int)':
:18:1: internal compiler error: Segmentation fault
   18 | }
  | ^
0x1786229 internal_error(char const*, ...)
???:0
0x100ff23 wi::lts_p_large(long const*, unsigned int, unsigned int, long const*,
unsigned int)
???:0
0x6a7c06 finish_struct_1(tree_node*)
???:0
0x6a9c8c finish_struct(tree_node*, tree_node*)
???:0
0x6cd958 morph_fn_to_coro(tree_node*, tree_node**, tree_node**)
???:0
0x6fd221 finish_function(bool)
???:0
0x7c47db c_parse_file()
???:0
0x896762 c_common_parse_file()
???:0

Compiler output from GCC trunk:
: In function 'dummy_coro foo(int)':
:18:1: internal compiler error: tree check: expected integer_cst, have
plus_expr in get_len, at tree.h:6066
   18 | }
  | ^
0x1dadf09 internal_error(char const*, ...)
???:0
0x69f111 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
???:0
0x739efa finish_struct_1(tree_node*)
???:0
0x73ca54 finish_struct(tree_node*, tree_node*)
???:0
0x77d64c morph_fn_to_coro(tree_node*, tree_node**, tree_node**)
???:0
0x7de6df finish_function(bool)
???:0
0x914885 c_parse_file()
???:0
0xa97472 c_common_parse_file()
???:0

[Bug middle-end/101688] g++.dg/warn/Wstringop-overflow-4.C fails on 32-bit archs with new jump threader

2021-08-03 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101688

Martin Sebor  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-08-03
 Status|UNCONFIRMED |NEW
   Keywords||diagnostic

--- Comment #2 from Martin Sebor  ---
I can confirm the unexpected warnings but the reason for them isn't that
they're somehow confused.  They're correct for the emitted IL.
Here's a small example:

$ cat pr101688.C && gcc -O2 -S -Wall -m32 pr101688.C
char *p, *q;

void f (int n)
{
  if (n < 0)
n = 0;

  p = (char*)new int[n];
  *p = 0;

  q = (char*)new int[n + 1];
  *q = 0;
}
pr101688.C: In function ‘void f(int)’:
pr101688.C:9:6: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
9 |   *p = 0;
  |   ~~~^~~
pr101688.C:8:23: note: destination object of size 0 allocated by ‘operator new
[]’
8 |   p = (char*)new int[n];
  |   ^

The IL the warning is issued for is the following:

   [local count: 1073741824]:
  if (n_3(D) < 0)
goto ; [25.50%]
  ...
   [local count: 273804168]:
  _29 = operator new [] (0);  <<< zero-sized allocation
  p = _29;
  MEM[(char *)_29] = 0;  <<< -Wstringop-overflow
  goto ; [100.00%]

The invalid code in bb 8 is first seen in the vrp1 dump:

   [local count: 1073741824]:
  if (n_3(D) < 0)
goto ; [25.50%]
  ...
   [local count: 273804168]:
  # n_25 = PHI <0(2)>
  # n.1_26 = PHI <0(2)>
  iftmp.0_27 = n.1_26 * 4;
  _29 = operator new [] (iftmp.0_27);
  p = _29;
  MEM[(char *)_29] = 0;

When i == 0, the first allocation creates a zero-sized object which then
results in an out-of-bounds store.  If this were real code (as opposed to a
test) I'd say the code is unsafe and warning for it is justified.  What's
unhelpful here is that the warning that ends up issued doesn't make the problem
clear.

[Bug tree-optimization/79028] Un-optimal/ incorrect forward propagation

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2017-01-09 00:00:00 |2021-8-3

--- Comment #2 from Andrew Pinski  ---
There are a lot of match-simplify patterns which should either have :s or check
for single use but someone needs to audit them.

[Bug tree-optimization/101758] Inconsistent optimizations with UBSan

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #9 from Andrew Pinski  ---
So my checks are not fully correct, I am not going to take my time to debug
this fully debug how we can remove the check.

[Bug tree-optimization/71343] missed optimization (can't "prove" shift and multiplication equivalence)

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/77705] Optimize away some static constructors

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Severity|normal  |enhancement

[Bug tree-optimization/71034] abs(f) u>= 0. is always true

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/101763] Comments in tree-vrp.c are way out of date

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

--- Comment #2 from Andrew Pinski  ---
The change happened in r11-439.

[Bug fortran/101760] [11/12 Regression] ICE in make_ssa_name_fn, at tree-ssanames.c:290 since r12-1319-gd4d38135b3137f1d

2021-08-03 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101760

Martin Liška  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
   Last reconfirmed||2021-08-03
Summary|[11/12 Regression] ICE in   |[11/12 Regression] ICE in
   |make_ssa_name_fn, at|make_ssa_name_fn, at
   |tree-ssanames.c:290 |tree-ssanames.c:290 since
   ||r12-1319-gd4d38135b3137f1d
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Started with r12-1319-gd4d38135b3137f1d.

[Bug tree-optimization/59564] False positive array -Warray-bounds check with -O2

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
So this was fixed by r5-6842 which was backported for GCC 4.9.3 also.

[Bug c++/101764] New: ICE for constexpr if within fold expression within lambda expression within a template

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

Bug ID: 101764
   Summary: ICE for constexpr if within fold expression within
lambda expression within a template
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: rejects-valid
  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/o944oWafx.
```C++
void f(auto i) {
  ([](T...) {
return (..., [] {
  if constexpr (T{0})
;
}());
  }(i));
}
void g() { f(0); }
```
```
: In instantiation of 'f(int):: [with T = {int}]':
:7:4:   required from 'void f(auto:1) [with auto:1 = int]'
:9:13:   required from here
:6:8: internal compiler error: in tsubst_pack_expansion, at
cp/pt.c:13102
6 | }());
  |^
0x1dadf09 internal_error(char const*, ...)
???:0
0x6e5511 fancy_abort(char const*, int, char const*)
???:0
0x962157 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
???:0
0x94de47 instantiate_decl(tree_node*, bool, bool)
???:0
0x7f5dbe maybe_instantiate_decl(tree_node*)
???:0
0x7f7520 mark_used(tree_node*, int)
???:0
0x710ad5 build_op_call(tree_node*, vec**, int)
???:0
0x9b4935 finish_call_expr(tree_node*, vec**, bool,
bool, int)
???:0
0x94de47 instantiate_decl(tree_node*, bool, bool)
???:0
0x99020b instantiate_pending_templates(int)
???:0
0x7fb2f9 c_parse_final_cleanups()
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug tree-optimization/101763] Comments in tree-vrp.c are way out of date

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

--- Comment #1 from Andrew Pinski  ---
Note I found this while trying to figure out what fixed PR 59564.

[Bug tree-optimization/101756] [12 Regression] ICE: verify_gimple failed (error: non-trivial conversion in 'ssa_name')

2021-08-03 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101756

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-03
 Ever confirmed|0   |1
 CC||marxin at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org

--- Comment #2 from Martin Liška  ---
Started with r12-1551-g3dfa4fe9f1a089b2.

  1   2   3   >