[Bug tree-optimization/87621] New: auto-vectorization fails for exponentiation code

2018-10-16 Thread hoganmeier at gmail dot com
: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- https://godbolt.org/z/bgieBT template T pow(T x, unsigned int n) { if (!n) return 1; T y = 1; while (n >

[Bug tree-optimization/87621] auto-vectorization fails for exponentiation code

2018-10-16 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87621 --- Comment #1 from krux --- Interestingly it happily unrolls the loop even with -fno-unroll-loops.

[Bug rtl-optimization/84101] [7/8/9 Regression] -O3 and -ftree-vectorize trying too hard for function returning trivial pair-of-uint64_t-structure

2018-10-16 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84101 --- Comment #4 from krux --- Also happens with pairs of floats: https://godbolt.org/z/QrP0VD

[Bug target/87650] New: suboptimal codegen for testing low bit

2018-10-18 Thread hoganmeier at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- int pow(int x, unsigned int n) { int y = 1; while (n > 1) { auto m = n%2; n = n/2; if (m) y *= x; x = x*x; } retur

[Bug tree-optimization/87621] outer loop auto-vectorization fails for exponentiation code

2018-10-16 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87621 --- Comment #3 from krux --- Yes see the godbolt link. clang compiles it down to a few vpmulld's.

[Bug tree-optimization/87913] New: max(n, 1) code generation

2018-11-06 Thread hoganmeier at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- unsigned int f(unsigned int num) { return num < 1 ? 1 : num; } int f2(int num) { return num < 1 ? 1 : num; } unsigned int g(unsigned int num) { return num

[Bug tree-optimization/87914] New: gcc fails to vectorize bitreverse code

2018-11-06 Thread hoganmeier at gmail dot com
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- $ gcc -fopenmp-simd -O3 -march=haswell -fopt-info-vec-omp-optimized-missed template T reverseBits(T x) { unsigned int s = sizeof(x) * 8; T mask = ~T(0

[Bug middle-end/50481] builtin to reverse the bit order

2018-11-08 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50481 --- Comment #4 from krux --- +1 The builtins already produce better code than a generic bitreverse implementation: https://godbolt.org/z/Um2Tit But using special hardware instructions automatically is even more important imho.

[Bug middle-end/12849] testing divisibility by constant

2018-11-08 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12849 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #5 from

[Bug c++/87656] Useful flags to enable with -Wall or -Wextra

2018-11-13 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87656 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #3 from

[Bug c++/45615] -Wshadow doesn't report class member shadowing

2018-11-13 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45615 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #2 from

[Bug tree-optimization/87915] emit warning if (explicit) vectorization failed

2018-11-07 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87915 --- Comment #2 from krux --- Yeah I'm using -fopt-info for manual performance analysis but that can't be enabled in the normal build as it's too noisy. Furthermore a proper warning can be turned into an error to ensure that developer

[Bug target/87913] max(n, 1) code generation

2018-11-07 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87913 --- Comment #2 from krux --- The case of function g is quite interesting because of the data dependencies and adc's latency: https://godbolt.org/z/0V8Dlx

[Bug tree-optimization/87915] New: emit warning if (explicit) vectorization failed

2018-11-06 Thread hoganmeier at gmail dot com
: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- When using #pragma omp simd for explicit vectorization shouldn't it warn if vectorization failed? clang has -Wpass-failed for that: http://lists.llvm.org

[Bug target/88013] can't vectorize rgb to grayscale conversion code

2018-11-14 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88013 --- Comment #4 from krux --- On x64 indeed both compilers generate a huge amount of code. https://godbolt.org/z/TH7mqn

[Bug target/88013] can't vectorize rgb to grayscale conversion code

2018-11-14 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88013 --- Comment #3 from krux --- A few NEON instructions are sufficient: https://web.archive.org/web/20170227190422/http://hilbert-space.de/?p=22 clang seems to generate similar code, see the godbolt links.

[Bug c++/87656] Useful flags to enable with -Wall or -Wextra

2018-11-13 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87656 --- Comment #5 from krux --- I meant -Wshadow=local.

[Bug target/88013] can't vectorize rgb to grayscale conversion code

2018-11-13 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88013 --- Comment #1 from krux --- Something like -march=armv8-a -mfpu=neon-fp-armv8 does not work either. https://godbolt.org/z/MpBQ0I

[Bug target/88013] New: can't vectorize rgb to grayscale conversion code

2018-11-13 Thread hoganmeier at gmail dot com
: target Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- #include void reference_convert(uint8_t * __restrict dest, uint8_t * __restrict src, int n) { for (int i=0; ihttps://godbolt.org/z/FPG3k_

[Bug target/88013] can't vectorize rgb to grayscale conversion code

2018-11-14 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88013 --- Comment #6 from krux --- -mfloat-abi=hard was missing indeed. It's a pity there's no warning like when trying to use the intrinsics. Still I see a lot more instructions, maybe that got fixed after v7.2? https://godbolt.org/z/OWzgXi

[Bug c++/38658] trivial try/catch statement not eliminated

2018-12-12 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38658 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #5 from

[Bug debug/88534] New: internal compiler error: in tree_add_const_value_attribute, at dwarf2out.c:20246

2018-12-17 Thread hoganmeier at gmail dot com
: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- #include #include #include template class basic_fixed_string { CharT content[N]; public: using

[Bug debug/88534] internal compiler error: in tree_add_const_value_attribute, at dwarf2out.c:20246

2018-12-17 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88534 krux changed: What|Removed |Added Keywords||ice-on-valid-code --- Comment #1 from krux ---

[Bug debug/88534] internal compiler error: in tree_add_const_value_attribute, at dwarf2out.c:20246

2018-12-17 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88534 --- Comment #2 from krux --- The code is based on https://github.com/hanickadot/compile-time-regular-expressions/blob/master/include/ctll/fixed_string.hpp

[Bug c/88566] New: -Wconversion not using value range information

2018-12-20 Thread hoganmeier at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- https://godbolt.org/z/p0RMde unsigned char foo(uint8_t pin) { if (pin >= 3 && pin <= 6) return pin - 2; if (pin >= 9 &&

[Bug c/88566] -Wconversion not using value range information

2018-12-20 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88566 --- Comment #1 from krux --- Even simpler example: uint8_t foo(uint8_t pin) { return pin > 0 ? pin - 1 : 0; }

[Bug tree-optimization/88440] New: size optimization of memcpy-like code

2018-12-10 Thread hoganmeier at gmail dot com
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- https://godbolt.org/z/RTji7B void foo(char* restrict dst, const char* buf) { for (int i=0; i<8; ++i) *dst++ = *buf++; } $ gcc -Os $ gcc -O2

[Bug tree-optimization/88440] size optimization of memcpy-like code

2018-12-11 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88440 --- Comment #3 from krux --- Adding -ftree-loop-distribute-patterns to -Os does not seem to make a difference though.

[Bug c++/63149] wrong auto deduction from braced-init-list

2019-01-26 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63149 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #3 from

[Bug debug/90441] [9 regression] corrupt debug info with LTO

2019-05-12 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #3 from krux --- Finally tried qemu+gdb on the original code: gdb-8.2.1/gdb/dwarf2read.c:9715: internal-error: void dw2_add_symbol_to_list(symbol*, pending**): Assertion `(*listhead) == NULL || (SYMBOL_LANGUAGE

[Bug lto/90523] lto1 segfault in arm_parse_cpu_option_name

2019-05-17 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90523 --- Comment #1 from krux --- So this one must be null: https://github.com/gcc-mirror/gcc/blob/65af043/gcc/config/arm/arm.c#L3148

[Bug lto/90523] New: lto1 segfault in arm_parse_cpu_option_name

2019-05-17 Thread hoganmeier at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Built a bleeding-edge arm-gcc toolchain. It works fine but when I tried newlib built with -flto I got a crash in lto1. $ arm-none

[Bug lto/90523] lto1 segfault in arm_parse_cpu_option_name

2019-05-17 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90523 --- Comment #3 from krux --- Possible, gcc was built with --disable-multilib --with-arch=armv7e-m --with-mode=thumb --with-float=soft. And if I replace -mcpu=cortex-m4 with -march=armv7e-m in my test command there's no crash.

[Bug target/88013] can't vectorize rgb to grayscale conversion code

2019-05-26 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88013 --- Comment #9 from krux --- (In reply to ktkachov from comment #7) > I tried current trunk (future GCC 9) > GCC 9 learned to avoid excessive widening during vectorisation, which is > what accounts for the large number of instructions you see.

[Bug debug/90441] [9/10 Regression] corrupt debug info with LTO

2019-05-26 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #20 from krux --- Thanks your patch worked! Just fyi: llvm-dwarfdump doesn't understand call-site info: https://bugs.llvm.org/show_bug.cgi?id=41846 Not sure if it's relevant.

[Bug debug/90441] [9/10 Regression] corrupt debug info with LTO

2019-05-26 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #22 from krux --- I can also reproduce it without any linker script, simplified code: int serial3_available() {} struct HardwareSerial3 { int available() { serial3_available(); } }; HardwareSerial3 Serial3; void yield()

[Bug debug/90441] [9/10 Regression] corrupt debug info with LTO

2019-05-26 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #24 from krux --- objdump -dCrS also prints these errors. It definitely fails to find the entry for main which is present according to objdump --dwarf: <1>: Abbrev Number: 8 (DW_TAG_subprogram) DW_AT_external: 1

[Bug debug/90441] [9/10 Regression] corrupt debug info with LTO

2019-05-26 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #23 from krux --- But it's so fragile, touch any part of the code and the error disappears. Like change serial3_available to void and you also get an additional symbol: 4160 0003 T mainmain.cpp:8

[Bug c/52981] Separate -Wpadded into two options

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52981 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #6 from

[Bug c++/68901] UBSan triggers false -Wpadded warning

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68901 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #3 from

[Bug middle-end/82853] Optimize x % 3 == 0 without modulo

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82853 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #34 from

[Bug target/90523] lto1 segfault in arm_parse_cpu_option_name

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90523 krux changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/68901] UBSan triggers false -Wpadded warning

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68901 --- Comment #5 from krux --- Wpadded only checks for input_location != BUILTINS_LOCATION currently (stor-layout.c). Maybe something like !DECL_ARTIFICIAL(rli->t) should be added there.

[Bug target/87076] -mcpu/-march not propagated through LTO bytecode (ice/segfault if arch flags do not match)

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87076 krux changed: What|Removed |Added CC||hoganmeier at gmail dot com --- Comment #5 from

[Bug c/52981] Separate -Wpadded into two options

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52981 --- Comment #7 from krux --- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68901 is an example of missed -Wpadded suppression.

[Bug c++/68901] UBSan triggers false -Wpadded warning

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68901 --- Comment #6 from krux --- Created attachment 46434 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46434=edit proposed patch

[Bug c++/68901] UBSan triggers false -Wpadded warning

2019-05-30 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68901 --- Comment #7 from krux --- Created attachment 46435 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46435=edit cleanup The previous patch should also allow removing these hacks (untested). Though TYPE_ARTIFICIAL wasn't set in any of

[Bug debug/90441] [9 regression] corrupt debug info with LTO

2019-05-12 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #1 from krux --- Created attachment 46343 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46343=edit llvm-dwarfdump --verify output FWIW llvm-dwarfdump --verify shows the same errors for both versions, but for gcc-9 it can't

[Bug debug/90441] [9 regression] corrupt debug info with LTO

2019-05-12 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #2 from krux --- By the way, with 8.3 there is no DWARF error, but nm -l does not show any file location for _VectorsFlash either.

[Bug driver/90443] New: -flto=n on Windows results in CreateProcess: No such file or directory

2019-05-12 Thread hoganmeier at gmail dot com
Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- Just using a dummy source: extern "C" void _start() {} $ arm-none-eabi-g++ -O3 -flto=2 main.cpp -nostdlib -o firmw

[Bug debug/90441] [9/10 Regression] corrupt debug info with LTO

2019-05-14 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441 --- Comment #18 from krux --- (In reply to Iain Sandoe from comment #14) > current trunk (27), manual regeneration of the > firmware.elf.ltrans0.ltrans.o -> > > (it's kinda frustrating that one can't see the link line, more tweaks are >

[Bug debug/90441] New: [9 regression] corrupt debug info with LTO

2019-05-12 Thread hoganmeier at gmail dot com
Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com Target Milestone: --- Originally occurred with arm-gcc 9.1 Reproduced it with Ubuntu 19.04 gcc 9.0, works with gcc 8.3. Couldn't reduce it further. mk20dx128.c

[Bug lto/90369] New: error: could not unlink output file

2019-05-06 Thread hoganmeier at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: hoganmeier at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Tested this ARM toolchain: http://www.freddiechopin.info/en/download/category/11-bleeding-edge-toolchain In a very specific case I get

[Bug lto/90369] error: could not unlink output file

2019-05-07 Thread hoganmeier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90369 --- Comment #4 from krux --- The code was automatically reduced, hence the empty linker script. Looks promising, seems like you found the cause.