[Bug tree-optimization/94092] Code size and performance degradations after -ftree-loop-distribute-patterns was enabled at -O[2s]+

2020-03-09 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94092 --- Comment #3 from Marc Glisse --- Does profile feedback (so we have an idea on the loop count) make any difference? It seems clear that for a loop that in practice just copies one long, having to arrange the arguments, make a function call, tes

[Bug c++/94141] New: c++20 rewritten operator== recursive call mixing friend and external operators for template class

2020-03-11 Thread glisse at gcc dot gnu.org
Keywords: wrong-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- (reduced from a user of boost/operators.hpp) template class A; template

[Bug tree-optimization/61338] too many permutation in a vectorized "reverse loop"

2020-03-16 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61338 --- Comment #3 from Marc Glisse --- Possibly easier is the case of a reduction, where permutations are clearly irrelevant. int f(int*arr,int size){ int sum=0; for(int i = 0; i < size; i++){ sum += arr[size-1-i]; } return sum; } We s

[Bug target/94194] x86: Provide feraiseexcept builtins

2020-03-16 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94194 --- Comment #1 from Marc Glisse --- Is there a convenient way for gcc to know the value of FE_DIVBYZERO, etc on the target? Do we need to hardcode it? Can we rely on different libc on the same processor to use the same value? What happens if the

[Bug tree-optimization/94234] missed ccp folding for (addr + 8 * n) - (addr + 8 * (n - 1))

2020-03-20 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94234 --- Comment #2 from Marc Glisse --- The closest we have is /* (A * C) +- (B * C) -> (A+-B) * C and (A * C) +- A -> A * (C+-1). which does not handle conversions, although it should be possible to add them.

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

2020-03-23 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94274 --- Comment #1 from Marc Glisse --- Detecting common beginnings / endings in branches is something gcc does very seldom. Even at -Os, for if(cond)f(b);else f(c); we need to wait until rtl-optimizations to get a single call to f. (of course the re

[Bug tree-optimization/94293] [missed optimization] Useless statements populating local string not removed

2020-03-23 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94293 --- Comment #1 from Marc Glisse --- Adding inline void* operator new(std::size_t n){return __builtin_malloc(n);} inline void operator delete(void*p)noexcept{__builtin_free(p);} inline void operator delete(void*p,std::size_t)noexcept{__builtin_fr

[Bug tree-optimization/94294] [missed optimization] new+delete of unused local string not removed

2020-03-23 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94294 --- Comment #2 from Marc Glisse --- (In reply to Eyal Rozenberg from comment #0) > Note: I suppose it's theoretically possible that this bug only manifests > because bug 94293 prevents the allocated space from being recognized as > unused; but

[Bug tree-optimization/94293] [missed optimization] Useless statements populating local string not removed

2020-03-23 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94293 --- Comment #4 from Marc Glisse --- Or just void f(){ int*p=new int[1]; *p=42; delete[] p; } while it does optimize for void f(){ int*p=new int; *p=42; delete p; } because the front-end gives us a clobber before operator delete.

[Bug libstdc++/94295] use __builtin_operator_new and __builtin_operator_delete when available

2020-03-24 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295 --- Comment #1 from Marc Glisse --- (In reply to Richard Smith from comment #0) > The C++ language rules do not permit optimization (eg, deletion) of direct > calls to 'operator new' and 'operator delete'. I thought that was considered a bug? Gc

[Bug tree-optimization/94294] [missed optimization] new+delete of unused local string not removed

2020-03-24 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94294 --- Comment #4 from Marc Glisse --- I don't believe there is a "new/delete" issue.

[Bug libstdc++/94295] use __builtin_operator_new and __builtin_operator_delete when available

2020-03-24 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295 --- Comment #5 from Marc Glisse --- (In reply to Richard Smith from comment #2) > (In reply to Marc Glisse from comment #1) > > (In reply to Richard Smith from comment #0) > > > The C++ language rules do not permit optimization (eg, deletion) of

[Bug c++/94314] New: [10 Regression] Optimizing mismatched new/delete pairs

2020-03-24 Thread glisse at gcc dot gnu.org
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- (originally posted at https://gcc.gnu.org/legacy-ml/gcc-patches/2019-08/msg00276.html , I don't know if we will do something about it

[Bug c++/94314] [10 Regression] Optimizing mismatched new/delete pairs since r10-2106-g6343b6bf3bb83c87

2020-03-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94314 --- Comment #5 from Marc Glisse --- I don't think we need heavy machinery linking new and delete (and if we did I'd be tempted to store it in some global table rather than in the nodes). The most important case is the global replacable functions,

[Bug libstdc++/94295] use __builtin_operator_new and __builtin_operator_delete when available

2020-03-26 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295 Marc Glisse changed: What|Removed |Added Status|UNCONFIRMED |NEW Keywords|

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

2020-03-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94356 --- Comment #1 from Marc Glisse --- That's because internally we use an unsigned type for offsets (including for the multiplication). There have been tries to change that...

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

2020-03-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94356 --- Comment #3 from Marc Glisse --- I tried https://gcc.gnu.org/pipermail/gcc-patches/2017-May/475037.html some time ago. Having a different type for the multiplication and the offsetting introduced a lot of NOPs and caused a few regressions (fro

[Bug libstdc++/63706] stl_heap.h:make_heap()'s worst time complexity doesn't conform with C++ standard

2020-03-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63706 Marc Glisse changed: What|Removed |Added Last reconfirmed||2020-03-29 Status|UNCONFIRMED

[Bug libstdc++/51965] Redundant move constructions in heap algorithms

2020-03-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51965 --- Comment #19 from Marc Glisse --- (In reply to Jonathan Wakely from comment #16) > (In reply to Marc Glisse from comment #5) > > (The split into push_heap and __push_heap is just so the first part can be > > inlined without the second, right?)

[Bug middle-end/94412] wrong code with -fsanitize=undefined and vectors

2020-03-30 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94412 Marc Glisse changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug c++/94141] c++20 rewritten operator== recursive call mixing friend and external operators for template class

2020-04-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94141 --- Comment #1 from Marc Glisse --- It looks like clang-10+ also generates an infinite loop on this code. Does the standard really give priority to some implicit function over a user-defined one that is an exact match?

[Bug c++/94141] c++20 rewritten operator== recursive call mixing friend and external operators for template class

2020-04-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94141 --- Comment #2 from Marc Glisse --- Ah, maybe the friend function is not quite a template, so the generated swapped function is not a template either, and thus it has priority over a template if both are exact matches? This is going to break a n

[Bug middle-end/62080] Suboptimal code generation with eigen library

2020-04-06 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62080 Marc Glisse changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug c++/94314] [10 Regression] Optimizing mismatched new/delete pairs since r10-2106-g6343b6bf3bb83c87

2020-04-08 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94314 --- Comment #10 from Marc Glisse --- I am still getting -1 at -O2 for #include #include int count = 0; __attribute__((malloc,noinline)) void* operator new[](unsigned long sz){++count;return ::operator new(sz);} void operator delete[](void* ptr

[Bug tree-optimization/94566] New: conversion between std::strong_ordering and int

2020-04-11 Thread glisse at gcc dot gnu.org
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- #include int conv1(std::strong_ordering s){ if(s==std::strong_ordering::less) return -1; if(s==std

[Bug tree-optimization/94589] New: Optimize (i<=>0)>0 to i>0

2020-04-13 Thread glisse at gcc dot gnu.org
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- g++-10 -std=gu++2a -O3 #include bool k(int i){ auto c=i<=>0; return c>0; } [local count: 1073741824]: if (

[Bug tree-optimization/94566] conversion between std::strong_ordering and int

2020-04-15 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94566 --- Comment #3 from Marc Glisse --- I thought we had code to recognize a switch that represents a linear function, I was hoping that it would kick in with your hoisting patch...

[Bug rtl-optimization/94798] Failure to optimize subtraction and 0 literal properly

2020-04-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94798 --- Comment #1 from Marc Glisse --- (In reply to Gabriel Ravier from comment #0) > Comparison here : https://godbolt.org/z/LZ8dBy In your future bug reports, could you please copy all relevant information instead of (or in addition to) linking t

[Bug tree-optimization/94801] Failure to optimize narrowed __builtin_clz

2020-04-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94801 --- Comment #1 from Marc Glisse --- Gcc considers that clz might return 32 on some platforms, it does not currently use target-specific information to restrict the range of clz output.

[Bug tree-optimization/94801] Failure to optimize narrowed __builtin_clz

2020-04-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94801 --- Comment #2 from Marc Glisse --- if(a==0)__builtin_unreachable(); lets gcc optimize the code.

[Bug libstdc++/94811] Please make make_tuple noexcept when possible

2020-04-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94811 Marc Glisse changed: What|Removed |Added Component|c++ |libstdc++ Severity|normal

[Bug rtl-optimization/94804] Failure to elide useless movs in 128-bit addition

2020-04-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94804 Marc Glisse changed: What|Removed |Added Keywords||ra --- Comment #2 from Marc Glisse --- Gc

[Bug rtl-optimization/94804] Failure to elide useless movs in 128-bit addition

2020-04-28 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94804 --- Comment #4 from Marc Glisse --- (In reply to Gabriel Ravier from comment #3) > Having similar problems with useless movs is from the same non > well-optimized register allocation on function boundaries ? I don't know, but possibly not. I'll

[Bug tree-optimization/94908] Failure to optimally optimize certain shuffle patterns

2020-05-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94908 --- Comment #1 from Marc Glisse --- Even if we write __builtin_shuffle, the vector lowering pass turns it into the same code (constructor of BIT_FIELD_REFs), which seems to indicate that the target does not handle this pattern.

[Bug tree-optimization/94911] Failure to optimize comparisons of VLA sizes

2020-05-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94911 --- Comment #1 from Marc Glisse --- gcc computes sizeof(a) as 4ul*(size_t)n, and unsigned types don't provide nice overflow guarantees, so that complicates things.

[Bug tree-optimization/94911] Failure to optimize comparisons of VLA sizes

2020-05-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94911 --- Comment #3 from Marc Glisse --- Since VLA is an extension for compatibility with C, it is strange that it behaves differently (does one use the value of n at the time of the typedef and the other at the time of the declaration?). This bug is

[Bug c++/94905] Bogus warning -Werror=maybe-uninitialized

2020-05-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94905 --- Comment #1 from Marc Glisse --- Several of us asked, and it was rejected. Your next step is to provide a self-contained testcase (preprocessed sources?). You may also want to check if it still warns in gcc-10.

[Bug tree-optimization/94919] Failure to recognize max pattern

2020-05-02 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94919 --- Comment #1 from Marc Glisse --- This seems related to another one you reported, in the category: i&-b == b?i:0 (for b∈{0,1}). The first form has the advantage of no branch, while the second is less obfuscated and simplifies more naturally (li

[Bug tree-optimization/94921] Failure to optimize nots with sub into single add

2020-05-02 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94921 --- Comment #1 from Marc Glisse --- x + y ?

[Bug tree-optimization/94930] Failure to optimize out subvsi in expansion of __builtin_memcmp with 1 as the operand with -ftrapv

2020-05-03 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94930 --- Comment #1 from Marc Glisse --- AFAIK -ftrapv doesn't work very well and is kind of abandoned, in favor of -fsanitize=signed-integer-overflow (possibly with -fsanitize-undefined-trap-on-error), which does generate the code you expect.

[Bug tree-optimization/94914] Failure to optimize check of high part of 64-bit result of 32 by 32 multiplication into overflow check

2020-05-04 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94914 --- Comment #4 from Marc Glisse --- I thought we might already simplify (u >> 32) != 0 to u >= cst (other possible forms are u != (uint64_t)(uint32_t)u, u & cst != 0, etc, I am trying to think which one looks most canonical). I expect in interes

[Bug tree-optimization/95001] std::terminate() and abort() do not have __builtin_unreachable() semantics

2020-05-08 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95001 --- Comment #3 from Marc Glisse --- Simpler example: [[noreturn]] void theend(); int f(int x){ if(x&7)theend(); return x&3; } (or replace "theend()" with "throw 42") We shouldn't compute x&3, it is always 0 in the branch where it is compu

[Bug c/95044] [10/11 Regression] -Wreturn-local-addr false alarm since r10-1741-gaac9480da1ffd037

2020-05-11 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95044 --- Comment #1 from Marc Glisse --- I think there is another very similar bug report. # buf_1 = PHI <&stack_buf(2), buf_15(6)> [...] if (&stack_buf != buf_1) in each branch, we thus know what buf_1 is, so we could replace it with buf_15 in

[Bug libstdc++/95065] Remove std::bind1st and std::bind2nd when building in -std=c++17

2020-05-11 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95065 Marc Glisse changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug libstdc++/91383] C++17 should remove some library feature deprecated in C++14

2020-05-11 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91383 Marc Glisse changed: What|Removed |Added CC||gcc at linkmauve dot fr --- Comment #6 fro

[Bug target/95115] [10 Regression] RISC-V 64: inf/inf division optimized out, invalid operation not raised

2020-05-13 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95115 --- Comment #1 from Marc Glisse --- I am seeing the same thing on x86_64, happens during FRE1, so it looks like tree-optimization.

[Bug target/95115] [10 Regression] RISC-V 64: inf/inf division optimized out, invalid operation not raised

2020-05-13 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95115 --- Comment #2 from Marc Glisse --- Or during CCP with the simpler double f(){ double d=__builtin_inf(); return d/d; } and all the -frounding-math -ftrapping-math -fsignaling-nans don't seem to help.

[Bug target/95115] [10 Regression] RISC-V 64: inf/inf division optimized out, invalid operation not raised

2020-05-13 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95115 --- Comment #4 from Marc Glisse --- (In reply to Jim Wilson from comment #3) > The assumption here seems to be that if the user is > dividing constants, then we don't need to worry about setting exception > bits. If I write (4.0 / 3.0) for insta

[Bug tree-optimization/95246] Failure to optimize comparison between differently signed chars

2020-05-20 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95246 --- Comment #1 from Marc Glisse --- On which version of LLVM did you see that? For me, gcc produces movzbl %dil, %edi movsbl %sil, %esi cmpl%esi, %edi setg%al while clang skips the first 2 lines (but st

[Bug c++/94141] c++20 rewritten operator== recursive call mixing friend and external operators for template class

2020-05-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94141 Marc Glisse changed: What|Removed |Added Last reconfirmed||2020-05-21 Status|UNCONFIRMED

[Bug sanitizer/95279] UBSan doesn't seem to detect pointer overflow in certain cases

2020-05-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95279 --- Comment #8 from Marc Glisse --- (In reply to Jakub Jelinek from comment #4) > There is nothing wrong on addition of -1, whether signed or cast to > size_t/uintptr_t, to a pointer, Looking at the standard (I am not a pro at that), one could e

[Bug sanitizer/95279] UBSan doesn't seem to detect pointer overflow in certain cases

2020-05-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95279 --- Comment #12 from Marc Glisse --- (In reply to Jakub Jelinek from comment #10) > 1 + (size_t) -1 give 0 It wasn't obvious to me that the operation was supposed to happen in some C/C++ type (they don't say which one) or in a mathematical, infi

[Bug c++/95351] Comparison with NAN optimizes incorrectly with -ffast-math disabled

2020-05-26 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95351 --- Comment #2 from Marc Glisse --- It might not be the issue, but merge_truthop_with_opposite_arm has a suspicious HONOR_NANS (type) where type is bool: the result of the comparison instead of one of the arguments.

[Bug middle-end/95353] [10/11 Regression] GCC can't build binutils

2020-05-26 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353 --- Comment #3 from Marc Glisse --- Do you need fr_literal to have size at least 1 (say, when creating an object on the stack), or can you use the official flexible array member (drop the 1, just [] in the declaration)?

[Bug tree-optimization/95393] Failure to optimize loop condition arithmetic for mismatched types

2020-05-28 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95393 --- Comment #1 from Marc Glisse --- It does optimize for me with -O2 or -O3. It could optimize earlier though, by the end of gimple, we are still trying to return max(s,0).

[Bug tree-optimization/95423] Failure to optimize separated multiplications by x and square of x

2020-05-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95423 --- Comment #3 from Marc Glisse --- We manage it with -fwrapv. This should happen late when we don't care about overflow anymore, or it needs to introduce casts to an unsigned type.

[Bug tree-optimization/95433] Failure to completely optimize simple compare after operations

2020-05-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95433 Marc Glisse changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug target/95435] bad builtin memcpy performance with znver1/znver2 and 32bit

2020-05-30 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95435 Marc Glisse changed: What|Removed |Added Target||x86-*-* --- Comment #3 from Marc Glisse -

[Bug tree-optimization/95489] Failure to optimize x && (x & y) to x & y

2020-06-03 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95489 --- Comment #2 from Marc Glisse --- (In reply to Richard Biener from comment #1) > (bit_and (ne (bit_and x_3 y_4) 0) (ne x_3 0)) This could be simplified > where I'd say we miss > > (bit_and (ne @0 integer_zerop) (ne @1 integer_zerop)) >

[Bug c++/95384] Poor codegen cause by using base class instead of member for Optional construction

2020-06-03 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95384 --- Comment #2 from Marc Glisse --- Or with less templates: struct A { A() = default; union S { constexpr S() noexcept : e() { } struct {} e; int i; } s; bool b = false; }; struct B : A { B() = default; using A::A; }; B f

[Bug middle-end/4210] should not warn in dead code

2020-06-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210 --- Comment #43 from Marc Glisse --- (In reply to Niels Möller from comment #42) > And what's the easiest way to run the the right compiler process (I guess > that's cc1) under gdb? gcc -c t.c -wrapper gdb,--args

[Bug libstdc++/95561] std::is_signed_v<__int128> is false

2020-06-06 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95561 --- Comment #1 from Marc Glisse --- Are you using -std=gnu++17 or -std=c++17 ?

[Bug tree-optimization/95643] Optimizer fails to realize that a variable tested twice in a row is the same both times

2020-06-11 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95643 --- Comment #1 from Marc Glisse --- After FRE1 we have _2 = x_9(D) == 0; if (_2 != 0) so we assert things for _2 and not x_9, and we lose the __builtin_unreachable information in CCP2.

[Bug libstdc++/90436] Redundant size checking in vector

2020-06-19 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 --- Comment #2 from Marc Glisse --- (writing down some notes) Calling size_type _M_check_len_one(const char* __s) const { if (max_size() - size() < 1) __throw_length_error(__N(__s)); const size_type

[Bug libstdc++/90436] Redundant size checking in vector

2020-06-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 --- Comment #3 from Marc Glisse --- // possibly assumes that ptrdiff_t and size_t have the same size size_type _M_check_len_one(const char* __str) const { ptrdiff_t __n = sizeof(_Tp); ptrdiff_t __ms = max_s

[Bug libstdc++/90436] Redundant size checking in vector

2020-06-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 --- Comment #4 from Marc Glisse --- (side note not related to the redundant size checking) It is surprising how, in the code from comment 2, adding v.reserve(1000) does not help, it even slows the program down slightly here (yes, that's rather ha

[Bug tree-optimization/95801] Optimiser does not exploit the fact that an integer divisor cannot be zero

2020-06-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95801 --- Comment #1 from Marc Glisse --- Except when dereferencing a pointer (?), gcc seldom uses an operation to derive properties on the operands, it mostly derives properties on the result. That's in large part because the information you are getti

[Bug c/95818] wrong "used uninitialized" warning

2020-06-22 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95818 --- Comment #3 from Marc Glisse --- Richard said "complete", that is the whole .i file, not just one random function. If we cannot reproduce the issue by copying your code and compiling it, we can't do anything about your report.

[Bug tree-optimization/95906] Failure to recognize max pattern with mask

2020-06-26 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95906 --- Comment #1 from Marc Glisse --- I'd say generate a (vec_)cond_expr, not directly a max. That is, replace the comparison with any truth_valued_p (hmm, that function probably stopped working for vectors when all comparisons were wrapped in vec_

[Bug tree-optimization/95663] static_cast checks for null even when the pointer is dereferenced

2020-06-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95663 --- Comment #12 from Marc Glisse --- (In reply to Jeffrey A. Law from comment #10) > __builtin_trap emits an actual trap into the instruction stream which halts > the process immediately which is *much* better from a security standpoint Regardle

[Bug tree-optimization/95926] Failure to optimize xor pattern when using temporary variable

2020-06-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95926 --- Comment #1 from Marc Glisse --- It is different to gcc because in the first case, tmp is used twice, while in the second case, each a&b is only used once, and gcc only transforms (a&b)^b to b&~a if this is the only use of a&b. Yes, this heuri

[Bug tree-optimization/95924] Failure to optimize some bit magic to one of the operands

2020-06-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95924 --- Comment #1 from Marc Glisse --- * If I replace ~a with !a, we manage to do everything with type bool. With ~a, we don't, we stick to int. * We don't handle a?b:false the same as a&&b. * Even for (a | !b) && (!(!a & b) && a) we don't complet

[Bug tree-optimization/95929] Failure to optimize tautological comparisons of comparisons to a single one

2020-06-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95929 --- Comment #1 from Marc Glisse --- Here gcc does optimize the first f to (a != 0) ^ (b != 0). However, for the second f, it does indeed generate something that looks like the first f before optimization... The optimization for the first f is pro

[Bug tree-optimization/95923] Failure to optimize bool checks into and

2020-06-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95923 --- Comment #1 from Marc Glisse --- (With one variant I ended up with (a|b)&(a==b), which we don't optimize to a&b) We don't optimize !(!a && !b) && !(!a && b) && !(a && !b) (we keep several branches), but we do optimize if I manually replace en

[Bug other/95971] [10 regression] Optimizer converts a false boolean value into a true boolean value

2020-06-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95971 --- Comment #11 from Marc Glisse --- while(!a.isZero()); that doesn't look like something you would find in real code. Are you waiting for a different thread to modify a? Then you should use an atomic operation. Are you waiting for the h

[Bug tree-optimization/96009] missed optimization with floating point operations and integer literals

2020-07-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96009 --- Comment #2 from Marc Glisse --- Note that we don't do the optimization if you replace double with long either.

[Bug c++/96065] Move elision of returned automatic variable doesn't happen the variable is enclosed in a block

2020-07-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96065 Marc Glisse changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/51571] No named return value optimization while adding a dummy scope

2020-07-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51571 Marc Glisse changed: What|Removed |Added CC||b7.10110111 at gmail dot com --- Comment #

[Bug tree-optimization/96108] Different behavior in DSE pass

2020-07-08 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96108 --- Comment #4 from Marc Glisse --- During optimization, we often have branches with dead code that would exhibit UB if it was ever executed. Cleaning up those branches as much as possible helps reduce code size, show that some variables (in the

[Bug c++/96121] Uninitialized variable copying not diagnosed

2020-07-08 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121 --- Comment #2 from Marc Glisse --- gcc warns for this at the level of actual instructions, not user code. Since A is empty, nothing uninitialized is getting copied.

[Bug c++/96121] Uninitialized variable copying not diagnosed

2020-07-08 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121 --- Comment #3 from Marc Glisse --- And this translation unit doesn't actually generate any code at all, so the way the warning is currently implemented has no chance of even looking at it.

[Bug c++/96121] Uninitialized variable copying not diagnosed

2020-07-08 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121 --- Comment #5 from Marc Glisse --- Yes, then we are back to the fact that it works for A=int but not for A a class containing an int.

[Bug libstdc++/96088] Range insertion into unordered_map is less effective than a loop with insertion

2020-07-09 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96088 --- Comment #3 from Marc Glisse --- (In reply to Jonathan Wakely from comment #2) > Or use unordered_map, equal_to<>> which > should perform better. Good idea. > We haven't implemented http://wg21.link/p0919r3 and http://wg21.link/p1690r1 > ye

[Bug tree-optimization/96369] Wrong evaluation order of || operator

2020-07-29 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96369 Marc Glisse changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug target/96327] Inefficient increment through pointer to volatile on x86

2020-07-30 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96327 --- Comment #5 from Marc Glisse --- I don't think bug 3506 has been fixed (its status seems wrong to me). But don't worry, there are several other duplicates that still have status NEW (bug 50677 for instance). This is a sensible enhancement requ

[Bug tree-optimization/96392] Optimize x+0.0 if x is an integer

2020-07-30 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96392 Marc Glisse changed: What|Removed |Added Last reconfirmed||2020-07-30 Status|UNCONFIRMED

[Bug tree-optimization/95433] Failure to completely optimize simple compare after operations

2020-08-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95433 --- Comment #5 from Marc Glisse --- Patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551154.html for the original testcase. Note that solving univariate polynomial equations *in the integers* (the rationals are not much hard

[Bug middle-end/96426] New: __builtin_convertvector ICE without lhs

2020-08-03 Thread glisse at gcc dot gnu.org
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- typedef long long veci __attribute__((vector_size(16))); typedef double vecf __attribute__((vector_size(16))); void f(veci v

[Bug tree-optimization/96433] Failed to optimize (A / N) * N <= A

2020-08-03 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96433 Marc Glisse changed: What|Removed |Added Component|c |tree-optimization Last reconfirmed|

[Bug target/70314] AVX512 not using kandw to combine comparison results

2020-08-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70314 --- Comment #4 from Marc Glisse --- We now generate for the original testcase vpcmpd $1, %zmm3, %zmm2, %k1 vpcmpd $1, %zmm1, %zmm0, %k0{%k1} vpmovm2d%k0, %zmm0 which looks great. However, using | instead of &,

[Bug tree-optimization/95906] Failure to recognize max pattern with mask

2020-08-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95906 --- Comment #3 from Marc Glisse --- With the patch (which only affects vectors), f becomes (a>b)?a:b. It should be easy to add the corresponding transform to MAX_EXPR in match.pd.

[Bug middle-end/88670] [meta-bug] generic vector extension issues

2020-08-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88670 Bug 88670 depends on bug 70314, which changed state. Bug 70314 Summary: AVX512 not using kandw to combine comparison results https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70314 What|Removed |Added ---

[Bug target/70314] AVX512 not using kandw to combine comparison results

2020-08-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70314 Marc Glisse changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug tree-optimization/96513] building terminated with -O3

2020-08-06 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96513 --- Comment #1 from Marc Glisse --- What you could do, even if it is private code, is reduce it (https://gcc.gnu.org/wiki/A_guide_to_testcase_reduction) until it is very small and doesn't give away any IP, and then post it. Otherwise, there is no

[Bug target/96528] New: [11 Regression] vector comparisons on ARM

2020-08-07 Thread glisse at gcc dot gnu.org
Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- Target: arm-none-linux-gnueabihf (see the discussion after https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551468

[Bug tree-optimization/96542] Failure to optimize simple code to a constant when storing part of the operation in a variable

2020-08-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96542 --- Comment #2 from Marc Glisse --- (In reply to Jakub Jelinek from comment #1) > In bar, this is optimized, because fold_binary_op_with_conditional_arg > optimizes > 255 >> (x ? 1 : 0) into x ? 127 : 255 and when multiplied by two in unsigned >

[Bug c/96550] gcc is smart in figuring out a non-returning function.

2020-08-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96550 --- Comment #1 from Marc Glisse --- Does -fno-delete-null-pointer-checks help?

[Bug target/50829] avx extra copy for _mm256_insertf128_pd

2020-08-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50829 Marc Glisse changed: What|Removed |Added Status|NEW |RESOLVED Known to work|

[Bug rtl-optimization/48037] Missed optimization: unnecessary register moves

2020-08-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48037 --- Comment #10 from Marc Glisse --- We now generate just sqrtpd %xmm0, %xmm0 for 2 and 4, sqrtpd (%rdi), %xmm0 for 3, and movupd (%rdi), %xmm0 sqrtpd %xmm0, %xmm0 for 1 (for alignment reasons I guess, the movu

[Bug tree-optimization/96563] Failure to optimize loop with condition to simple arithmetic

2020-08-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96563 Marc Glisse changed: What|Removed |Added Last reconfirmed||2020-08-11 Ever confirmed|0

  1   2   3   4   5   6   7   8   9   10   >