[Bug testsuite/69598] gcc.dg/tree-ssa/vrp47.c scan-tree-dump-times vrp1 "[xy][^ ]* !=" 0 fails for powerpc64-linux-gnu

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|tree-optimization   |testsuite
   Target Milestone|--- |5.0
 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=38219

--- Comment #1 from Andrew Pinski  ---
Fixed a long time ago by r5-1748 .

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

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

--- Comment #6 from Andrew Pinski  ---
The final conversion should happen at the RTL level (or during expansion).
simplify-rtx.c has this:
  /* If STORE_FLAG_VALUE is 1, (minus 1 (comparison foo bar)) can be done
 by reversing the comparison code if valid.  */

I will implement the rtl level in simplify-rtx.c first and then add the others.

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

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

--- Comment #5 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #4)
> Hmm,  thinking about expanding this further:
Even further.
int f1(int n)
{
if (n&~8) __builtin_unreachable();
return 63 - n;
}

 CUT 
So the nonzero bits just need to be make sure they no non-overlapping bits.

[Bug tree-optimization/53979] ((a ^ b) | a) not optimized to (a | b)

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

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

--- Comment #21 from Andrew Pinski  ---
Looks to be fixed in GCC 11.  It still fails for me with GCC 10.3 though.

[Bug c++/92431] ICE with spaceship in constexpr evaluation

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

--- Comment #7 from Andrew Pinski  ---
Looks to be fixed for the GCC 10 release.

[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-07-28 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

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=96921
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-07-28
 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org

--- Comment #2 from Andrew Pinski  ---
So looking at this one (and one which I just assigned myself):
unsigned long f(unsigned long x)
{
if (x >= 64)__builtin_unreachable();
x = x ^ 63;
unsigned long y = x; ;; Range is still [0,63]
unsigned long z = 64 - y; ;; is similar to (63 - y) +1 -> (y ^ 63) + 1 -> x + 1
return z;
}

So mine:

Something like:
(simplify
 (minus INTEGER_CST@0 SSA_NAME@1)
 (if (exact_power2(@0) && get_nonzero_bits(@1) == (@0 - 1)
  (add (bit_xor! @1 @0) {build_one_cst (type); }))

[Bug tree-optimization/98953] Failure to optimize two reads from adjacent addresses into one

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Last reconfirmed|2021-02-04 00:00:00 |2021-7-28

[Bug tree-optimization/98955] Failure to optimize shift+compare to single shift

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Last reconfirmed||2021-07-28
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

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

[Bug tree-optimization/98909] Failure to optimize odd loop pattern

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/98966] Failure to optimize conditional or with 1 based on boolean condition to direct or

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

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-07-28
 Status|UNCONFIRMED |NEW
   Severity|normal  |enhancement

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

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

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

--- Comment #4 from Andrew Pinski  ---
Hmm,  thinking about expanding this further:

int f1(int n)
{
if (n&~63) __builtin_unreachable();
return 63 - n;
}
int f2(int n)
{
if (n&~63) __builtin_unreachable();
return 63 ^ n;
}
These two should be able to get the same code which happens on clang already.

Something like (but with the expansion of the +!, etc.)
(simplify
 (minus INTEGER_CST@0 SSA_NAME@1)
 (if (exact_power2(@0 + 1) && get_nonzero_bits(@1) == @0
  (bit_xor @1 @0)))

[Bug tree-optimization/85316] [meta-bug] VRP range propagation missed cases

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

Bug 97967 Summary: Missed optimization opportunity for VRP
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97967

   What|Removed |Added

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

[Bug tree-optimization/97967] Missed optimization opportunity for VRP

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Fixed in GCC 11 already.

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

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
I was thinking if we see:
  _2 = 1 - _1;

and _1 has a range of [0,1] aka boolean
turn it into _1 ^ 1

There is already a pattern which turns ((int)a)^1 into (int)(~a).

You can see the other patterns in action if you write the code as:
int
foo1 (_Bool a, _Bool b)
{
  int c = a;
  c ^= 1;
  int d = b;
  d = d ^ 1;
  int e = c & d;
  return e ^ 1;
}

So something like:
(simplify
 (minus integer_one@0 SSA_NAME@1)
 (if (TREE_CODE (@0) == SSA_NAME
  && ssa_name_has_boolean_range (@0))
  (bit_xor @1 @0)))

That is for boolean types/ranges, we always use a ^ 1 (or ~a) instead of 1 - a
Take:
int
fooneg (_Bool a)
{
  return 1 - a;
}
int
fooxor (_Bool a)
{
  return a^1;
}

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

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
 Ever confirmed|0   |1
   Last reconfirmed||2021-07-28
 Status|UNCONFIRMED |NEW
 CC||pinskia at gcc dot gnu.org

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

[Bug tree-optimization/96457] PRE gets confused by punned load handling

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Last reconfirmed|2020-08-04 00:00:00 |2021-7-28

[Bug tree-optimization/100858] Simple common code hoisting is not performed

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

Andrew Pinski  changed:

   What|Removed |Added

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

[Bug tree-optimization/89847] Simplify subexpressions of % constant

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug c++/84976] ICE: Segmentation fault (cp_build_modify_expr())

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Fixed in GCC 10+.

[Bug c++/61292] auto keyword to reference generates wrong alignment move (causing runtime segfault)

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-28
 Status|UNCONFIRMED |NEW
Summary|auto keyword to vector  |auto keyword to reference
   |reference generates wrong   |generates wrong alignment
   |alignment move (causing |move (causing runtime
   |runtime segfault)   |segfault)
 Ever confirmed|0   |1
   Keywords||wrong-code

--- Comment #4 from Andrew Pinski  ---
This is unrelated to vector_size attribute even.
Take:
typedef float float32x4_t;
typedef float __attribute__( ( aligned(1) ) ) float32x4a4_t;


void add11(float32x4a4_t * x, float y, float32x4_t v) {
   auto & k1 = *(float32x4a4_t*)(x);
   auto & k2 = *(float32x4a4_t*)(x);
   k1 +=v;
   k2 += k1+v;
}

void add98(float32x4a4_t * x, float y, float32x4_t v) {
   float32x4a4_t & k1 = *(float32x4a4_t*)(x);
   float32x4a4_t & k2 = *(float32x4a4_t*)(x);
   k1 +=v;
   k2 += k1+v;
}
-- CUT -
With aarch64 at -O2 -mstrict-align, we get float loads/stores for add11 but
correctly get the byte loads/stores for add98.

Note I notice clang gets this wrong too.

[Bug c++/92467] gcc miscompiles ternary expression with omitted first operand ?: involving C++ prvalues

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code

--- Comment #4 from Andrew Pinski  ---
Before GCC 9, the code was rejected even.

[Bug c++/51317] [C++0x] [DR 587] Wrong value category of conditional expression where lvalue operands differ only in cv-qualification

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #6 from Andrew Pinski  ---
Fixed for GCC 5 and testcase was added at the time.

[Bug c++/60565] Bogus not-in-scope error

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||8.0
 Status|NEW |RESOLVED
   Target Milestone|--- |8.0
   Keywords||rejects-valid
 Resolution|--- |FIXED

--- Comment #6 from Andrew Pinski  ---
This works in GCC 8 and above.

[Bug c++/92485] [9 only] g++ ICE unexpected expression '' of kind asm_expr

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |9.5
Summary|g++ ICE unexpected  |[9 only] g++ ICE unexpected
   |expression '' of |expression '' of
   |kind asm_expr   |kind asm_expr

[Bug c++/91095] internal compiler error: in tsubst_copy

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|WAITING |RESOLVED

--- Comment #2 from Andrew Pinski  ---
No testcase provided in the last 2 years so closing as invalid.

[Bug c++/78217] Duplicate decls handling with auto

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

[Bug c++/78217] Duplicate decls handling with auto

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

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

[Bug c++/78217] Duplicate decls handling with auto

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||ppluzhnikov at google dot com

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

[Bug c++/60352] [C++11] Bogus "error: conflicting declaration 'auto i'"

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug c++/85790] c++17 - Access control issue with template argument deduction

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid

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

[Bug c++/90475] Diagnostic for designated initializer could be a lot better

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2019-05-14 00:00:00 |2021-7-28

--- Comment #1 from Andrew Pinski  ---
clang gives a good error message:
:3:25: error: field designator 'k' does not refer to any field in type
'X'
X f() { return {.i=42, .k=17}; }
^
1 error generated.

[Bug tree-optimization/79002] Weird c++ assembly code generated for tail call

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79002

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2017-01-05 00:00:00 |2021-7-27
  Component|c++ |tree-optimization

--- Comment #6 from Andrew Pinski  ---
Still happens on the trunk.
The first tailr does not detect the tail recursion but the second one does.

[Bug c++/68842] Better error output when template needed before dependent name

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68842

Andrew Pinski  changed:

   What|Removed |Added

 CC||soko.slav at yandex dot ru

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

[Bug c++/90495] Incorrect parsing of a()->b construction

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90495

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
(In reply to Marek Polacek from comment #1)
> Changed in r236221.  Not a bug: the fix is to use the template
> disambiguator.  
> 
> But the diagnostics is pretty awful so I'll confirm the PR for that part.

That would make this a dup of PR 68842 .

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

[Bug c++/60531] template function not resolved when comparing functions

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60531

Andrew Pinski  changed:

   What|Removed |Added

 CC||roman.perepelitsa at gmail dot 
com

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

[Bug c++/71382] Unary plus doesn't work with pointers to instantiations of function templates

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71382

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This is a dup of bug 60531 which is fixed in GCC 10+.  The testcase is already
there for this case even.

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

[Bug c++/70608] Braced initializer in default argument misses friendship

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70608

Andrew Pinski  changed:

   What|Removed |Added

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

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

[Bug c++/64696] [C++14] braced-init-list does not respect designated initializer

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64696

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid, wrong-code

--- Comment #2 from Andrew Pinski  ---
(In reply to Jason Merrill from comment #1)
> G++ implements issue 1467, so the only bug is with the designated
> initializer, which is an extension for C compatibility.

Well not exactly an extension only more :).  It was added for C++20.

Anyways this seems fixed on the trunk.

[Bug c++/69059] [C++14] Invalid rejection of expression as not-a-constant-expression

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69059

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid

--- Comment #1 from Andrew Pinski  ---
I can't reproduce this on released versions of GCC. GCC 5.5.0 works and GCC
6.1.0 works

[Bug c++/68678] [5 Regression] Initialization of pointer by constant expression using static ctor.

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68678

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||4.8.5, 6.0
 Resolution|--- |FIXED
   Target Milestone|--- |6.0
Summary|Initialization of pointer   |[5 Regression]
   |by constant expression  |Initialization of pointer
   |using static ctor.  |by constant expression
   ||using static ctor.
  Known to fail||4.9.0, 5.5.0
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
Fixed in GCC 6.

[Bug c++/55986] RHS of logical operators may render LHS unevaluated in constant-expression

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55986

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Keywords||accepts-invalid
   Target Milestone|--- |6.0
 Status|UNCONFIRMED |RESOLVED

--- Comment #6 from Andrew Pinski  ---
Fixed in GCC 6 with r6-4886 (note this is expected because we delay
simplifications until after semantics anlysis now).

[Bug libgcc/101655] canadian compile of libgcc uses native cc as the compiler instead of the target cross compiler

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101655

--- Comment #5 from Andrew Pinski  ---
Can you provide the exact steps you are doing?
Because I think you are misunderstanding how this works.

So if you use --host=x86_64-w64-mingw32 .

configure:2358: checking build system type
configure:2372: result: x86_64-pc-linux-gnu
configure:2419: checking host system type
configure:2432: result: x86_64-w64-mingw32
configure:2452: checking target system type
configure:2465: result: x86_64-w64-mingw32

But it uses the wrong compiler for the target libraries.

Also I see you had built the cross compiler in the src directory:
Configured with: ./configure --disable-libstdcxx-verbose --disable-multilib
--disable-nls --enable-fully-dynamic-string --enable-languages=c,c++,lto
--enable-large-address-aware --enable-mingw-wildcard --enable-threads=mcf
--target=x86_64-w64-mingw32

Don't do that.

[Bug c++/99969] g++ incorrectly thinks a private destructor is available

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99969

--- Comment #1 from Andrew Pinski  ---
This seems fixed since GCC 11.

[Bug c++/94564] C++20: Three-way comparison between pointer and nullptr accepted

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94564

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
 Status|NEW |RESOLVED
 Depends on||87699
 Resolution|--- |FIXED

--- Comment #2 from Andrew Pinski  ---
This was fixed by the patch which fixed bug 87699 expectly.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87699
[Bug 87699] Implement CWG 1512

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||accepts-invalid, wrong-code

--- Comment #13 from Andrew Pinski  ---
Here is a run time testcase of the same issue from PR 86032:
struct Empty
{
Empty& operator=(const Empty&) = default;
};

template
class ShowType;

template<>
struct ShowType{int t = 0;};
template<>
struct ShowType{int t = 1;};

int main()
{
  ShowType example;
  return example.t;
}

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

Andrew Pinski  changed:

   What|Removed |Added

 CC||ihorelo at mail dot ru

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

[Bug c++/86032] non standard copy operator is used for empty class

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86032

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
This is dup of bug 54319 which was just debugging.

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

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

--- Comment #11 from Andrew Pinski  ---
For the original testcase, I think r0-98505 introduce the failure.

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

--- Comment #10 from Andrew Pinski  ---
It is the code in call.c that makes a difference:
  if (is_really_empty_class (type, /*ignore_vptr*/true))
{
  /* Avoid copying empty classes.  */
  val = build2 (COMPOUND_EXPR, type, arg, to);
  suppress_warning (val, OPT_Wunused);
}
  else if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base)))
{
  if (is_std_init_list (type)
  && conv_binds_ref_to_prvalue (convs[1]))
warning_at (loc, OPT_Winit_list_lifetime,
"assignment from temporary % does "
"not extend the lifetime of the underlying array");
  arg = cp_build_fold_indirect_ref (arg);
  val = build2 (MODIFY_EXPR, TREE_TYPE (to), to, arg);
}
  else
{
  /* We must only copy the non-tail padding parts.  */
  tree arg0, arg2, t;
  tree array_type, alias_set;

  arg2 = TYPE_SIZE_UNIT (as_base);
  to = cp_stabilize_reference (to);
  arg0 = cp_build_addr_expr (to, complain);

  array_type = build_array_type (unsigned_char_type_node,
 build_index_type
   (size_binop (MINUS_EXPR,
arg2, size_int (1;
  alias_set = build_int_cst (build_pointer_type (type), 0);
  t = build2 (MODIFY_EXPR, void_type_node,
  build2 (MEM_REF, array_type, arg0, alias_set),
  build2 (MEM_REF, array_type, arg, alias_set));
  val = build2 (COMPOUND_EXPR, TREE_TYPE (to), t, to);
  suppress_warning (val, OPT_Wunused);
}

if we do the middle one only, we get the correct type.
I won't be able to debug this any further. But I suspect because we are
lowering the AST too early, we don't do the correct type dealing here due to
the COMPOUND_EXPR.

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

--- Comment #9 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #8)
> I think the problem is here in init.c:
>   /* If the type has data but no user-provided default ctor, we need to
> zero
>  out the object.  */
>   if (type_has_non_user_provided_default_constructor (type)
>   && !is_really_empty_class (type, /*ignore_vptr*/true))
> {
>   tree field_size = NULL_TREE;
>   if (exp != true_exp && CLASSTYPE_AS_BASE (type) != type)
> /* Don't clobber already initialized virtual bases.  */
> field_size = TYPE_SIZE (CLASSTYPE_AS_BASE (type));
>   init = build_zero_init_1 (type, NULL_TREE,
> /*static_storage_p=*/false,
> field_size);
>   init = build2 (INIT_EXPR, type, exp, init);
>   finish_expr_stmt (init);
> }

Nope.

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

--- Comment #8 from Andrew Pinski  ---
I think the problem is here in init.c:
  /* If the type has data but no user-provided default ctor, we need to
zero
 out the object.  */
  if (type_has_non_user_provided_default_constructor (type)
  && !is_really_empty_class (type, /*ignore_vptr*/true))
{
  tree field_size = NULL_TREE;
  if (exp != true_exp && CLASSTYPE_AS_BASE (type) != type)
/* Don't clobber already initialized virtual bases.  */
field_size = TYPE_SIZE (CLASSTYPE_AS_BASE (type));
  init = build_zero_init_1 (type, NULL_TREE,
/*static_storage_p=*/false,
field_size);
  init = build2 (INIT_EXPR, type, exp, init);
  finish_expr_stmt (init);
}

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||4.4.7

--- Comment #7 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #6)
> (In reply to Andrew Pinski from comment #5)
> > Note even the following X causes an error:
> > struct X {int :1;};
> > 
> > Maybe that will give a hint of where the bug is located.
> 
> Which makes this a regression even :).
> The above with just one anonymous bitfield field is accepted until GCC 6.
> 
> But this should give even more of what is the underlaying bug.

r6-7811 exposed the latent bug for the anonymous bitfield case (which is
expected).

The original testcase worked in 4.4.7 also.

[Bug c++/54319] [9/10/11/12 Regression] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

Andrew Pinski  changed:

   What|Removed |Added

Summary|empty class causes error|[9/10/11/12 Regression]
   |while non-empty does not|empty class causes error
   ||while non-empty does not
   Target Milestone|--- |9.5

--- Comment #6 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #5)
> Note even the following X causes an error:
> struct X {int :1;};
> 
> Maybe that will give a hint of where the bug is located.

Which makes this a regression even :).
The above with just one anonymous bitfield field is accepted until GCC 6.

But this should give even more of what is the underlaying bug.

[Bug c++/54319] empty class causes error while non-empty does not

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54319

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid
Summary|Assignment to rvalue|empty class causes error
   ||while non-empty does not

--- Comment #5 from Andrew Pinski  ---
Note even the following X causes an error:
struct X {int :1;};

Maybe that will give a hint of where the bug is located.

[Bug c++/72507] incorrectly accepts invalid C++11 code that tries to allocate an incomplete type

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72507

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2016-07-26 00:00:00 |2021-7-27

--- Comment #1 from Andrew Pinski  ---
Looks like we are not instantiating A::t unless you use it directly.

That is if we add:
int r = A::t;

The program is rejected as expected.

[Bug c++/96256] Invalid consteval call not rejected

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96256

Andrew Pinski  changed:

   What|Removed |Added

URL|https://godbolt.org/z/zeEY9 |
   |6   |

--- Comment #1 from Andrew Pinski  ---
clang crashes on this code :).

[Bug c++/52761] [C++11] Missing diagnostic for opaque unscoped enum declaration without base

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52761

Andrew Pinski  changed:

   What|Removed |Added

 CC||anders.granlund.0 at gmail dot 
com

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

[Bug c++/67016] Redeclaration of enum

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67016

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug tree-optimization/100740] [9/10/11/12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r9-4145

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100740

Andrew Pinski  changed:

   What|Removed |Added

 CC||phd at phd dot re

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

[Bug tree-optimization/101653] [9/10/11/12 Regression] Bad code generated when optimizing nested for loops

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101653

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
So the loop of PR 100740 is same as this one so marking as a dup.

That is both have a double loop and the inner one has loop exit which is bound
by comparing of the induction variable that is counting how many times inside
the loop it has happened and comparing it against in the inner loop induction
variable.

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

[Bug tree-optimization/101653] [9/10/11/12 Regression] Bad code generated when optimizing nested for loops

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101653

--- Comment #2 from Andrew Pinski  ---
Confirmed,
ivcannon is turning the loops into:
   [local count: 79093198]:
  goto ; [100.00%]

   [local count: 357878150]:
  a_8 = a_11 + 1;
  c_14 = c_3 + 2;
  goto ; [100.00%]

   [local count: 79093198]:
  # _5 = PHI <123(6)>
  return _5;

   [local count: 375401868]:
  # c_3 = PHI <1(2), c_14(4)>
  # a_11 = PHI <0(2), a_8(4)>
  # ivtmp_20 = PHI <2(2), ivtmp_1(4)>
  c_6 = c_3 + 1;
  ivtmp_1 = ivtmp_20 - 1;
  if (ivtmp_1 == 0)
goto ; [5.50%]
  else
goto ; [94.50%]

Removing all of the if conditions on c < a and turning it into true ...

[Bug tree-optimization/101653] [9/10/11/12 Regression] Bad code generated when optimizing nested for loops

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101653

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
Summary|Bad code generated when |[9/10/11/12 Regression] Bad
   |optimizing nested for loops |code generated when
   ||optimizing nested for loops
  Component|c   |tree-optimization
   Target Milestone|--- |9.5

[Bug c++/92604] GCC accepts invalid conversion from designated initializer list

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92604

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Fixed for GCC 12, most likely by r12-955.

[Bug c++/86581] constexpr variable allows uninitialized member of anonymous struct inside union

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86581

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||diagnostic

--- Comment #3 from Andrew Pinski  ---
GCC 10+ rejects it but does NOT say why though:
:6:13: error: 'V{V::{V{0}}}' is not a constant expression
6 | constexpr V v;
  | 


So keeping open for that.

(In reply to Ted Lyngmo from comment #2)
> Does this bug cover this case? This compiles with g++ but clang++ gives
> "error: constexpr union constructor does not initialize any member".

No.

[Bug c++/98440] [9/10 Regression] Accepts ill-formed reinterpret_cast(1)

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98440

Andrew Pinski  changed:

   What|Removed |Added

 CC||zhonghao at pku dot org.cn

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

[Bug c++/86633] invalid with rvalue references

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86633

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
This is a dup of bug 98440.

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

[Bug c++/87699] Implement CWG 1512

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87699

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

[Bug c++/86228] ordered comparison between pointer and zero

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86228

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
This is a dup of bug 87699 which is fixed for GCC 11+

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

[Bug c++/80380] misleading behavior with designated initializers for std::vector

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80380

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug c++/95369] braced-init-list with designated initializers as template-argument rejected

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95369

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.0

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-27
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

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

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

Andrew Pinski  changed:

   What|Removed |Added

 CC||andreim77 at yahoo dot com

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

[Bug c++/67663] ambiguous namespace/class name not reported as error

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67663

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug c++/71919] Redefinition of user-defined conversions (via typedef) shouldn't compile

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71919

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 8+.

Most likely by r8-2664 but I could be wrong.

[Bug c++/53931] [C++11] braced function style cast to reference should be prvalue

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53931

--- Comment #3 from Andrew Pinski  ---
typedef int &
void zip1(int x) { ir{x}; }  

Also is accepted.

[Bug c++/69127] inconsistent handling of initializers of zero-length array members

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69127

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-07-27

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

[Bug c++/60009] g++ allows copy-initialization of an array of class type from a non-braced string literal

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60009

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Fixed in GCC 7, I cannot figure out which revision fixed it though.

Note r8-7514 fixes the error message though where in GCC 7 would print out some
error messages dealing with no matching of constructors.

[Bug c++/65906] using-declaration allowed for non-direct base class

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65906

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
This was fixed with r7-4255: Implement P0136R1, Rewording inheriting
constructors.

Which makes sense.

[Bug c++/101651] vector extension and element access vs C++17 constexpr functions

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101651

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
Here is clang's error message which is 1% wrong.

:7:16: error: constexpr function never produces a constant expression
[-Winvalid-constexpr]
constexpr auto gen () {
   ^
:11:18: note: subexpression not valid in a constant expression
ret[i] = ret1[0];
 ^
1 error generated.
Compiler returned: 1

[Bug c++/101651] vector extension and element access vs C++17 constexpr functions

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101651

Andrew Pinski  changed:

   What|Removed |Added

Summary|vector extension and|vector extension and
   |element write vs C++17  |element access vs C++17
   |constexpr functions |constexpr functions

--- Comment #2 from Andrew Pinski  ---
So it is any vector array that matters:
#ifdef WORK
 #include 
 typedef std::array vec;
#else
 typedef char vec __attribute__((vector_size(2)));
#endif
constexpr auto gen () {
vec ret{1,2};
vec ret1{1,2};
for (int i = 0; i < sizeof(vec); ++i) {
ret[i] = ret1[0];
}
 //   ret1[0] =3;
 //   ret1[0] =ret[0];
return ret1;
};
 auto m = gen();

Note clang rejects the above for non -DWORK case.

[Bug c++/101651] vector extension and element write vs C++17 constexpr functions

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101651

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Keywords||rejects-valid
   Last reconfirmed||2021-07-27
 Blocks||55004
Summary|constexpr write to simd |vector extension and
   |vector element  |element write vs C++17
   ||constexpr functions

--- Comment #1 from Andrew Pinski  ---
Confirmed.
I really doubt any of the vector extensions are really supported with
constexpr.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
[Bug 55004] [meta-bug] constexpr issues

[Bug bootstrap/101574] gcc/sparseset.h:215:20: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101574

--- Comment #7 from Andrew Pinski  ---
(In reply to Thomas Schwinge from comment #6)
> Short summary: I ran into an unexpected '0xa5a5a5a5' in
> 'gcc/warning-control.cc', and a search through email archives pointed me to
> PR101292, PR101204, which superficially indeed do look similar.
> 
> Anybody got a good suggestion about how to proceed here?


0xa5a5a5a5 is written when the GC has reclaimed the memory. So the best way is
to a reduced testcase using --param ggc-min-expand=0 --param ggc-min-heapsize=0
(note start with --param ggc-min-expand=1 --param ggc-min-heapsize=1 otherwise
the compiler will be supper slow).

[Bug tree-optimization/96779] Failure to optimize comparison of negative version of self

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96779

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> This is simple, I will take.
> (for cmp (eq ne)
>  (simplify
>   (cmp:c @0 (negate @0))
>(if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (@0)))
> (cmp:c @0 { build_zero_cst (TREE_TYPE(@0)); })
> 
> Should be enough.

But it is wrong for wrapping types.

For wrapping types:
-a == a -> (a << 1) == a or (a + a) == 0
But this is worse on targets which have a pattern for -a CMP a (hint aarch64).
So for wrapping types keep the -a == a is the best I think.

[Bug tree-optimization/101650] (len | N) == len is transformed to len & N != 0

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101650

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

[Bug tree-optimization/101591] (a|b) ==/!= a -> (b & ~a) ==/!= 0 on gimple

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101591

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
(In reply to Richard Biener from comment #4)
> Not sure if it is cheaper - it's one more operation on GIMPLE so (a|b) == a
> looks more canonical?

I agree.
I filed the constant one as PR 101650 after not realizing I filed this one
already too :).

So this is a dup of bug 101650 really :).

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

[Bug tree-optimization/101650] (len | N) == len is transformed to len & N != 0

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101650

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-07-27
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=101590

[Bug tree-optimization/101650] New: (len | N) == len is transformed to len & N != 0

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101650

Bug ID: 101650
   Summary: (len | N) == len is transformed to len & N != 0
   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: ---

While looking at PR 101590, I noticed this one.
#include 

const size_t N = 4;

bool foo(size_t len) {
size_t newlen = len | N;
return newlen == len;
}


(for cmp  (NE EQ)
 icmp (EQ NE)
 (simplify
  (cmp (bit_ior @0 INTEGER_CST@1) @0)
  (icmp (bit_and @0 @1) ({ build_zero_cst (TREE_TYPE (@0)); })
 )
)

This is already done for bit_and.

[Bug tree-optimization/101590] (len & - N) <= len is not optimized to 1

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101590

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> (In reply to Richard Biener from comment #1)
> > it doesn't even have to be -N, any unsigned & N <= unsigned
> 
> Here are the ones which are valid:
> 
> U | N < U -> false
> U & N <= U -> true
> U & N > U -> false
> U | N >= U -> true
> 
> (for cmp (LT GE)
>  (simplify
>   (cmp (bit_ior @0 INTEGER_CST@1) @0)
>   ({ constant_boolean_node (cmp == GE, type); })))
> (for cmp (LE GT)
>  (simplify
>   (cmp (bit_and @0 INTEGER_CST@1) @0)
>   ({ constant_boolean_node (cmp == LE, type); })))
> 
> I don't see an easy way to combine these two patterns though.

I forgot the check for unsigned :).

[Bug tree-optimization/101590] (len & - N) <= len is not optimized to 1

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101590

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-27
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org

--- Comment #2 from Andrew Pinski  ---
(In reply to Richard Biener from comment #1)
> it doesn't even have to be -N, any unsigned & N <= unsigned

Here are the ones which are valid:

U | N < U -> false
U & N <= U -> true
U & N > U -> false
U | N >= U -> true

(for cmp (LT GE)
 (simplify
  (cmp (bit_ior @0 INTEGER_CST@1) @0)
  ({ constant_boolean_node (cmp == GE, type); })))
(for cmp (LE GT)
 (simplify
  (cmp (bit_and @0 INTEGER_CST@1) @0)
  ({ constant_boolean_node (cmp == LE, type); })))

I don't see an easy way to combine these two patterns though.

[Bug c++/101649] -Wdouble-promotion warning emitted when floating point literals are not actually promoted to doubles

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101649

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||diagnostic

--- Comment #3 from Andrew Pinski  ---
It is a promotion to double, just happens GCC is able to undo the promotion.

Note -Wconversion also avoids warning in similar cases where there is implicit
conversion and then the conversion was removed.

[Bug c/101645] warn about neg of unsigned type should be added to -Wsign-conversion

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101645

Andrew Pinski  changed:

   What|Removed |Added

Summary|-Wsign-conversion misses|warn about neg of unsigned
   |negation of unsigned int|type should be added to
   ||-Wsign-conversion
   Keywords||diagnostic
   Severity|normal  |enhancement

--- Comment #2 from Andrew Pinski  ---
I don't know if this is useful to even to add to -Wsign-conversion.
The documentation is clear here:
Warn for implicit conversions that may change the sign of an integer value,
like assigning a signed integer expression to an unsigned integer variable. 

- is just two comp not rather than neg :)

[Bug target/101543] extra zeroing of empty struct argument/return value

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101543

--- Comment #2 from Andrew Pinski  ---
Note RTL optimizers don't like registers being uninitilized but maybe there is
way to do it ...

[Bug c++/70331] missing error dereferencing a dangling pointer in constexpr function

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70331

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-27
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

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

[Bug c++/91907] ['17] Constexpr of member function pointer as template parameter results in inconsistent diagnostics

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91907

--- Comment #2 from Andrew Pinski  ---
Seems fixed on the trunk.  But I could not figure out which patch fixed it so a
bisect would be useful.

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

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

Bug 81781 Summary: constexpr pointer comparsion error
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81781

   What|Removed |Added

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

[Bug c++/89074] valid pointer equality constexpr comparison rejected

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89074

Andrew Pinski  changed:

   What|Removed |Added

 CC||bobk-off at yandex dot ru

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

[Bug c++/81781] constexpr pointer comparsion error

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81781

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug c++/97458] C++ parsing fails when calling specialized template method inside lambda

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97458

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-27
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
An easier work around is:
[p](){ p->template fn(); }; 

Confirmed.

[Bug c++/66475] Access checking in templates circumvented with 'using' (C++11)

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66475

Andrew Pinski  changed:

   What|Removed |Added

 CC||kyle.strand at beckman dot com

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

  1   2   3   4   5   6   7   8   9   10   >