[Bug c++/101823] GCC generates the wrong string in the assembly code.

2021-08-08 Thread bootmgr at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101823

--- Comment #1 from bootmgr at 163 dot com  ---
Created attachment 51276
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51276=edit
test.cc

[Bug c++/101823] New: GCC generates the wrong string in the assembly code.

2021-08-08 Thread bootmgr at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101823

Bug ID: 101823
   Summary: GCC generates the wrong string in the assembly code.
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bootmgr at 163 dot com
  Target Milestone: ---

Created attachment 51275
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51275=edit
test.s

The gcc I compiled generated wrong assembly code on Windows.
This gcc is Canadian compiled from Ubuntu.

Error Messages:
H:\cxx>g++ test.cc
C:\Users\ADMINI~1\AppData\Local\Temp\ccxMVKI1.s: Assembler messages:
C:\Users\ADMINI~1\AppData\Local\Temp\ccxMVKI1.s:43: Warning: missing closing
`"'
C:\Users\ADMINI~1\AppData\Local\Temp\ccxMVKI1.s:43: Error: invalid character
(0xa in mnemonic

Configured with: ../gcc/configure --disable-multilib --disable-nls
--disable-rpath --disable-win32-registry --enable-graphite
--enable-languages=c,c++,jit,lto --enable-mingw-wildcard --enable-threads=posix
--disable-libstdcxx-pch --disable-
libstdcxx-verbose --enable-fully-dynamic-string --enable-large-address-aware
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64

[Bug target/43025] 32-bit x86 switch table refers to local symbols with -fPIC

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

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=28211

--- Comment #2 from Andrew Pinski  ---
Filed the bug with gas since I can reproduce the issue with binutils 2.30
still.
https://sourceware.org/bugzilla/show_bug.cgi?id=28211

[Bug tree-optimization/80406] Reduced false positive test case for -Warray-bounds with -O3

2021-08-08 Thread brlcad at mac dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80406

--- Comment #4 from Sean  ---
Can confirm the warning no longer appears to issue (at least as of GCC 11).

[Bug target/40546] -fwhole-program -shared with externally_visible gives R_X86_64_PC32 errors

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Keywords||wrong-code
   Target Milestone|--- |4.6.0
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Andrew Pinski  ---
There was many fixes for IPA and binds local for 4.6.
This was fixed by one of those.

Most likely it was r0-103118.

[Bug target/40988] incorrect code when using ..._bit macros from asm/bitops.h in a loop in userspace program

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

--- Comment #1 from Andrew Pinski  ---
I suspect the inline-asm is broken, I am 90% sure of it.

[Bug target/39783] -ftls-model can not be specified independently of -fpic/-fpie

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |WONTFIX

[Bug target/39783] -ftls-model can not be specified independently of -fpic/-fpie

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
Yes the code does:
  if (kind < flag_tls_default)
kind = flag_tls_default;


And the order of the enum:
Enum
Name(tls_model) Type(enum tls_model) UnknownError(unknown TLS model %qs)

EnumValue
Enum(tls_model) String(global-dynamic) Value(TLS_MODEL_GLOBAL_DYNAMIC)

EnumValue
Enum(tls_model) String(local-dynamic) Value(TLS_MODEL_LOCAL_DYNAMIC)

EnumValue
Enum(tls_model) String(initial-exec) Value(TLS_MODEL_INITIAL_EXEC)

EnumValue
Enum(tls_model) String(local-exec) Value(TLS_MODEL_LOCAL_EXEC)

Changing this is not going to happen.

[Bug target/33437] potentially valid construct rejected

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED
  Known to fail||

--- Comment #2 from Andrew Pinski  ---
This is not a valid C.  That is (int)(long)x where
sizeof(long)!=sizeof(int)!=sizeof(void*) the linker might not know the value at
link time and therefor will need a runtime relocation and then it might not
load at load time as the value would have gotten truncated.

[Bug target/33725] Could eliminate argument push for the second const function for same arguments

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Severity|normal  |enhancement

[Bug target/11925] segment violation due to incorrect operand constraints

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |3.4.0
 Status|NEW |RESOLVED
   Host|i686-pc-linux-gnu   |
  Build|i686-pc-linux-gnu   |
 Resolution|--- |FIXED

--- Comment #9 from Andrew Pinski  ---
This was fixed with r0-54273.

[Bug target/54821] Microblaze: Position independent code for byte access is incorrect.

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

Andrew Pinski  changed:

   What|Removed |Added

 Target||Microblaze
  Component|middle-end  |target
   Severity|major   |normal

[Bug target/39856] [4.4/4.5 Regression] ICE in subst_stack_regs_pat, at reg-stack.c:1386

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||ygepes at gmail dot com

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

[Bug middle-end/50316] ICE on fortran code with -O2 and -march=core2 options

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #7 from Andrew Pinski  ---
The original was a dup of bug 39856 . The second one did not have a testcase so
just closing as a dup.

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

[Bug ipa/87624] improve interprocedural clean up of null pointer checks

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org
   Last reconfirmed|2018-10-17 00:00:00 |2021-8-8

--- Comment #3 from Andrew Pinski  ---
callsite  void h(void*, void*)/1 -> void f(void*)/0 : 
   param 0: PASS THROUGH: 1, op nop_expr
 value: 0x0, mask: 0x
 Unknown VR
callsite  void h(void*, void*)/1 -> void f(void*)/0 : 
   param 0: PASS THROUGH: 0, op nop_expr, agg_preserved
 value: 0x0, mask: 0x
 Unknown VR

I wonder if ipa-cp (ipa-vrp) could get value range from the new range
infrastructure.

[Bug ipa/66363] ICE in modified test inline-39.c

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-09

--- Comment #3 from Andrew Pinski  ---
Still happens on the trunk.

[Bug c++/91008] error redeclaring the same type involving a non-type template argument

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

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

[Bug preprocessor/66909] Internal Compiler Error when #including files from /sys on Linux

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Resolution|--- |FIXED
   Target Milestone|--- |7.0
 Status|NEW |RESOLVED

--- Comment #4 from Andrew Pinski  ---
So the problem is when it is warning:
  if (regular && total != size && STAT_SIZE_RELIABLE (file->st))
cpp_error (pfile, CPP_DL_WARNING,
   "%s is shorter than expected", file->path);


So I think it was fixed by r7-1651.

[Bug preprocessor/66909] Internal Compiler Error when #including files from /sys on Linux

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

--- Comment #3 from Andrew Pinski  ---
Here is 4.7 backtrace:
t65.c:1:0: internal compiler error: Segmentation fault
0x7547af crash_signal
/bajas/pinskia/src/toolchain-47/scripts/../src/gcc/toplev.c:348
0xa55004 linemap_macro_map_lookup
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/line-map.c:583
0xa55004 linemap_lookup
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/line-map.c:514
0xa551ca linemap_macro_loc_to_spelling_point
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/line-map.c:919
0xa551ca linemap_resolve_location
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/line-map.c:1069
0xa5524b linemap_location_in_system_header_p
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/line-map.c:758
0xa4066e diagnostic_report_diagnostic
/bajas/pinskia/src/toolchain-47/scripts/../src/gcc/diagnostic.c:524
0x4dd784 c_cpp_error
   
/bajas/pinskia/src/toolchain-47/scripts/../src/gcc/c-family/c-common.c:8944
0xa4a3fd cpp_diagnostic
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/errors.c:64
0xa4a556 cpp_error
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/errors.c:79
0xa4ec4f read_file_guts
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/files.c:645
0xa4ec4f read_file
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/files.c:678
0xa4f6bd should_stack_file
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/files.c:723
0xa4f6bd _cpp_stack_file
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/files.c:801
0xa47b35 do_include_common
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/directives.c:792
0xa487e0 _cpp_handle_directive
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/directives.c:491
0xa5443c _cpp_lex_token
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/lex.c:1952
0xa583c7 cpp_get_token_1
/bajas/pinskia/src/toolchain-47/scripts/../src/libcpp/macro.c:2245
0x4e8044 c_lex_with_flags
/bajas/pinskia/src/toolchain-47/scripts/../src/gcc/c-family/c-lex.c:302
0x4a651f c_lex_one_token
/bajas/pinskia/src/toolchain-47/scripts/../src/gcc/c-parser.c:219

[Bug tree-optimization/46352] ICE: division by zero with -fdump-tree-tracer

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
  Known to work||4.7.0
 Resolution|--- |FIXED
   Target Milestone|--- |4.7.0

--- Comment #3 from Andrew Pinski  ---
This condition will never happen in 4.7.0+.
Because we will not have the case where we have one BB there:
  if (n_basic_blocks_for_fn (fun) <= NUM_FIXED_BLOCKS + 1)
return 0;

[Bug c++/101367] [coroutines] destructor for capture in lambda temporary operand to co_yield expression called twice

2021-08-08 Thread noah at vectorized dot io via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101367

--- Comment #3 from Noah Watkins  ---
Happy to work on providing a different reproducer if it is helpful.
This was the first smallish example we could create, and the `free of
an invalid pointer error` seemed as good enough as any unexpected
behavior for a similar situation.

On Sun, Aug 8, 2021 at 5:40 PM davidledger at live dot com.au
 wrote:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101367
>
> David Ledger  changed:
>
>What|Removed |Added
> 
>  CC||davidledger at live dot 
> com.au
>
> --- Comment #2 from David Ledger  ---
> that may be expected, as std::string frees on destruction, where as an empty
> capture list doesn't.
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object

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

--- Comment #4 from David Ledger  ---
It still seems like a bug though.

[Bug c++/101367] [coroutines] destructor for capture in lambda temporary operand to co_yield expression called twice

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

David Ledger  changed:

   What|Removed |Added

 CC||davidledger at live dot com.au

--- Comment #2 from David Ledger  ---
that may be expected, as std::string frees on destruction, where as an empty
capture list doesn't.

[Bug middle-end/94497] Branchless clamp in the general case gets a branch in a particular case ?

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

--- Comment #7 from Andrew Pinski  ---
On a related note, I Notice we are doing a load for the constant forming of 0
here.  That seems less than optimial.

[Bug middle-end/85237] missed optimisation opportunity for large/negative shifts

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug target/101821] Redundant xor eax eax

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101821

--- Comment #9 from Jeremy R.  ---
Thank you for the resources and for your insight, it's much appreciated.
Is there interest in updating the intentional false-dependency logic to not
fire for architectures newer than cannonlake?

[Bug tree-optimization/101822] Codegen bug for popcount

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Last reconfirmed||2021-08-08
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Severity|normal  |enhancement
 CC||pinskia at gcc dot gnu.org

--- Comment #2 from Andrew Pinski  ---
MIne, phiopt is not working for this case:
  if (n_4(D) != 0)
goto ; [89.00%]
  else
goto ; [11.00%]

   [local count: 105119324]:
  _9 = __builtin_popcount (n_4(D));
  count_13 = (uint32_t) _9;

   [local count: 118111600]:
  # count_12 = PHI 

The code in phiopt for handling casts is not done correctly.

[Bug target/101821] Redundant xor eax eax

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

--- Comment #8 from Andrew Pinski  ---
(In reply to Jeremy R. from comment #7)
> Does the false dependency still apply to modern CPUs?
How modern is modern?

Skylake fixed this for lzcnt and tzcnt.
Cannon Lake (and Ice Lake) fixed this for popcnt.

https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/desktop-6th-gen-core-family-spec-update.pdf

This is from
https://stackoverflow.com/questions/25078285/replacing-a-32-bit-loop-counter-with-64-bit-introduces-crazy-performance-deviati/54429148#54429148

[Bug middle-end/84858] wrong exception handling of std::function

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

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

[Bug tree-optimization/101822] Codegen bug for popcount

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101822

--- Comment #1 from Jeremy R.  ---
Never mind, 101821 was invalid and the initial xor eax eax is by design (still
wondering whether this applies to new CPUs though). There is still a
discrepancy between this code and the __builtin_popcount code though.

[Bug target/101821] Redundant xor eax eax

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101821

--- Comment #7 from Jeremy R.  ---
Does the false dependency still apply to modern CPUs?

[Bug target/101821] Redundant xor eax eax

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101821

--- Comment #6 from Jeremy R.  ---
Ah thank you @Andrew Pinski @Jakub Jelinek

[Bug tree-optimization/101822] New: Codegen bug for popcount

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101822

Bug ID: 101822
   Summary: Codegen bug for popcount
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: llvm at rifkin dot dev
  Target Milestone: ---

GCC cleverly optimizes the following loop into a popcount intrinsic:

uint32_t foo(uint32_t n) {
uint32_t count = 0;
while(n) {
n &= n - 1;
count++;
}
return count;
}

But the generated assembly is highly redundant https://godbolt.org/z/nbGb13G5W:

foo(unsigned int):
xor eax, eax
xor edx, edx
popcnt  eax, edi
testedi, edi
cmove   eax, edx
ret

if(n == 0) __builtin_unreachable(); does seem to help the compiler's analysis.

It seems here the compiler is not realizing both the loop and popcnt intrinsic
are well-defined for n == 0. This is closely related to another bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101821.

[Bug target/101821] Redundant xor eax eax

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
See PR 62011 for more details.

[Bug target/101821] Redundant xor eax eax

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

--- Comment #4 from Jakub Jelinek  ---
That is not unnecessary nor redundant, but fully intentional.
See e.g. PR62011.

[Bug target/101821] Redundant xor eax eax

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|tree-optimization   |target
Summary|Redundant xor eax eax   |Redundant xor eax eax
   |related to popcount |
   |intrinsic   |
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Andrew Pinski  ---
This is by design.

/* X86_TUNE_AVOID_FALSE_DEP_FOR_BMI: Avoid false dependency
   for bit-manipulation instructions.  */
DEF_TUNE (X86_TUNE_AVOID_FALSE_DEP_FOR_BMI, "avoid_false_dep_for_bmi",
  m_SANDYBRIDGE | m_CORE_AVX2 | m_GENERIC)

[Bug tree-optimization/101821] Redundant xor eax eax related to popcount intrinsic

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101821

Jeremy R.  changed:

   What|Removed |Added

Summary|Redundant xor eax eax   |Redundant xor eax eax
   |related to  |related to popcount
   |__builtin_popcount  |intrinsic

--- Comment #2 from Jeremy R.  ---
Seems to effect all

[Bug target/29776] result of ffs/clz/ctz/popcount/parity are already sign-extended

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||gpiez at web dot de

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

[Bug middle-end/50168] __builtin_ctz() and intrinsics __bsr(), __bsf() generate extra sign extend on x86_64

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #12 from Andrew Pinski  ---
Dup of bug 29776.

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

[Bug tree-optimization/101821] Redundant xor eax eax

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101821

--- Comment #1 from Jeremy R.  ---
This happens with __builtin_popcount as well, not just std::popcount. This
appears to have started in GCC 4.9.2. https://godbolt.org/z/4dGWvT5zr

[Bug tree-optimization/101821] New: Redundant xor eax eax

2021-08-08 Thread llvm at rifkin dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101821

Bug ID: 101821
   Summary: Redundant xor eax eax
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: llvm at rifkin dot dev
  Target Milestone: ---

Gcc is generating an unnecessary and redundant xor eax eax in the following
code

#include 
#include 
uint32_t pop(uint32_t n) {
return std::popcount(n);
}


pop(unsigned int):
xor eax, eax
popcnt  eax, edi
ret

https://godbolt.org/z/81o1Y6T5x

[Bug tree-optimization/51428] Some code after SSA expand does nothing

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
  Component|middle-end  |tree-optimization

--- Comment #3 from Andrew Pinski  ---
Mine for GCC 13 for bitfield lowering.
With the current code I have (which is applied to GCC 10 base compiler), we
get:
  _7 = MEM  [(struct f *)a_5(D)];
  _8 = _7 & 3;
  _3 = _8 != 0;
  _10 = BIT_INSERT_EXPR <_7, _3, 0 (1 bits)>;
  MEM  [(struct f *)a_5(D)] = _10;

And:
  _8 = _7 & 3;
  _6 = _8 == 3;
  _10 = BIT_INSERT_EXPR <_7, _6, 0 (1 bits)>;

both are not good really as we don't need to extract bit 0 really.

[Bug middle-end/34475] TLS and PIE don't mix on x86_64

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

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=10434
 Status|ASSIGNED|RESOLVED
 Resolution|--- |MOVED

--- Comment #4 from Andrew Pinski  ---
It was a binutils issue, and has been fixed for a long time now (~12 years).
See https://sourceware.org/bugzilla/show_bug.cgi?id=10434 .

[Bug middle-end/47011] ICE when using attribute optimize

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
(In reply to Mat Hostetter from comment #3)
> In the full example this meant g++ miscompiled std::vector::begin to use the
> wrong calling convention, which when linked into other objects expecting the
> proper calling convention would cause a crash.

That was PR 60062.

[Bug target/60062] [4.7 Regression] wrong code (for code with the optimize attribute) at -O1 and above on x86_64-linux-gnu in 32-bit mode

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||vogu00 at gmail dot com

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

[Bug middle-end/54068] Compiler passes wrong argument to function when using optimize attribute with -O3

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6619)  
/* Caller and callee must agree on the calling convention, so
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6620)
 checking here just optimize means that with
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6621)
 __attribute__((optimize (...))) caller could use regparm convention
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6622)
 and callee not, or vice versa.  Instead look at whether the callee
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6623)
 is optimized or not.  */

So dup of bug 60062.

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

[Bug middle-end/40317] verify_flow_info ICE with nested functions and non-local goto/labels

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

Andrew Pinski  changed:

   What|Removed |Added

Summary|verify_flow_info ICE with   |verify_flow_info ICE with
   |nested functions|nested functions and
   ||non-local goto/labels
   Last reconfirmed|2012-02-03 00:00:00 |2021-8-8

--- Comment #2 from Andrew Pinski  ---
Still fails on the trunk.

[Bug c++/101783] unnecessary error when top level cv qualifier is dropped

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

nick huang  changed:

   What|Removed |Added

 CC||nickhuang99 at hotmail dot com

--- Comment #5 from nick huang  ---
Created attachment 51274
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51274=edit
suggested fix for PR101783

Here is my suggested fix for this bug. The root cause of this bug is that it
considers reference with cv qualifier as an error by generating value for
variable "bad_quals". However, this is not correct for case of typedef. Here I
quote spec:
"Cv-qualified references are ill-formed except when the cv-qualifiers
are introduced through the use of a typedef-name ([dcl.typedef],
[temp.param]) or decltype-specifier ([dcl.type.decltype]),
in which case the cv-qualifiers are ignored."

[Bug middle-end/46119] -fsplit-stack - code crashes when passing large struct via stack

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-08-08
  Known to work||4.8.0, 4.8.5
Summary|-fsplit-stack   |-fsplit-stack - code
   |-fstack-protector-all - |crashes when passing large
   |code crashes when passing   |struct via stack
   |large struct via stack  |
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
  Known to fail||4.9.0

--- Comment #2 from Andrew Pinski  ---
-fsplit-stack is enough.  It worked in GCC 4.7.x and 4.8.x but broke again in
4.9.0.

The one where it worked main had (clang also has this):
leaq-32776(%rsp), %r11
cmpq%fs:112, %r11
jae .L6

The one where it fails has:

leaq-16392(%rsp), %r11
cmpq%fs:112, %r11

[Bug middle-end/29253] expand_abs wrong default code for floating point

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2008-02-04 14:27:46 |2021-8-8

--- Comment #12 from Andrew Pinski  ---
This is still true as far as I can tell by reading the code.
The case where it will happen is REAL_MODE_FORMAT does not have a simple sign
bit or 

GET_MODE_SIZE (mode) <= UNITS_PER_WORD && the mode does not exist

Which I think the first is true for IBM 128bit long doubles.

Note I don't know if IBM 128bit long double is an important use case.

[Bug middle-end/29864] Folding conversion unsigned long long to float

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Fixed at r0-87005.

[Bug middle-end/24590] Static function named "main" treated as the real main

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

--- Comment #5 from Andrew Pinski  ---
config/frv/frv.h:#define INVOKE__main
config/rs6000/eabi.h:#define INVOKE__main

I think the other ones that invokve __main is mingw/cygwin targets.
I wonder if there is a way to get rid of this really.

[Bug middle-end/21223] Output register variable is reloaded into the wrong register for asm

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=87600,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=86939,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=87899
  Known to fail||4.9.0, 8.1.0
   Target Milestone|--- |9.0
 Status|NEW |RESOLVED
  Known to work||9.1.0

--- Comment #5 from Andrew Pinski  ---
So this is fully fixed in GCC 9+. LRA fixes the problems that reload had.  (LRA
had a similar bug but had been fixes see the linked bug reports).

[Bug libfortran/101820] New: fatal error: ISO_Fortran_binding.h: No such file or directory

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

Bug ID: 101820
   Summary: fatal error: ISO_Fortran_binding.h: No such file or
directory
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libfortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ubizjak at gmail dot com
  Target Milestone: ---

There are quite some FAILs in the gfortran testsuite, e.g.:

FAIL: gfortran.dg/ISO_Fortran_binding_1.f90   -O0  (test for excess errors)
FAIL: gfortran.dg/ISO_Fortran_binding_1.f90   -O1  (test for excess errors)
FAIL: gfortran.dg/ISO_Fortran_binding_1.f90   -O2  (test for excess errors)
FAIL: gfortran.dg/ISO_Fortran_binding_1.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: gfortran.dg/ISO_Fortran_binding_1.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/ISO_Fortran_binding_1.f90   -Os  (test for excess errors)
...

where:

/home/uros/git/gcc/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c:3:10:
fatal error: ISO_Fortran_binding.h: No such file or directory
compilation terminated.
compiler exited with status 1
FAIL: gfortran.dg/ISO_Fortran_binding_1.f90   -O3 -g  (test for excess errors)
Excess errors:
/home/uros/git/gcc/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c:3:10:
fatal error: ISO_Fortran_binding.h: No such file or directory
compilation terminated.

UNRESOLVED: gfortran.dg/ISO_Fortran_binding_1.f90   -O3 -g  compilation failed
to produce executable


The file ISO_Fortran_binding.h is present in the libgfortran build directory,
but it looks to me that -I is missing when building the testcase:

/home/uros/gcc-build/gcc/testsuite/gfortran/../../gfortran
-B/home/uros/gcc-build/gcc/testsuite/gfortran/../../
-B/home/uros/gcc-build/x86_64-pc-linux-gnu/./libgfortran/
/home/uros/git/gcc/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.f90
-fdiagnostics-plain-output -fdiagnostics-plain-output -O3 -g -pedantic-errors
/home/uros/git/gcc/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c -dumpbase 
-B/home/uros/gcc-build/x86_64-pc-linux-gnu/./libgfortran/.libs
-L/home/uros/gcc-build/x86_64-pc-linux-gnu/./libgfortran/.libs
-L/home/uros/gcc-build/x86_64-pc-linux-gnu/./libgfortran/.libs
-L/home/uros/gcc-build/x86_64-pc-linux-gnu/./libatomic/.libs
-B/home/uros/gcc-build/x86_64-pc-linux-gnu/./libquadmath/.libs
-L/home/uros/gcc-build/x86_64-pc-linux-gnu/./libquadmath/.libs
-L/home/uros/gcc-build/x86_64-pc-linux-gnu/./libquadmath/.libs -lm -o
./ISO_Fortran_binding_1.exe
/home/uros/git/gcc/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c:3:10:
fatal error: ISO_Fortran_binding.h: No such file or directory
compilation terminated.

Adding "-I/home/uros/gcc-build/x86_64-pc-linux-gnu/libgfortran" to the above
command fixes the compilation.

[Bug c++/94162] ICE [neg] bad return type in defaulted <=>

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work|11.1.0  |

--- Comment #11 from Andrew Pinski  ---
(In reply to Cameron from comment #10)
> Notice the use of 'int*' as the comparison type.  GCC11 series will still
> crash.

Confirmed, this testcase ICEs on the trunk also.

[Bug c++/80143] ICE on placement new in gimplify_init_ctor_eval, at gimplify.c:4436

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

--- Comment #5 from Andrew Pinski  ---
(In reply to Martin Liška from comment #4)
> I think it was rather fixed in r8-7466-g3ec16e3610721403.

Yes that is more likely, I was trying to find that but I could not :).

[Bug target/43153] Pass -mtune=i686 to assembler for -march=i686 or higher

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Confirmed.  Though I don't know how important it is any more with x86_64 being
in the majority now.

[Bug middle-end/42543] ICE when using va_arg

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||4.6.4, 4.7.1
 Status|NEW |RESOLVED
   Target Milestone|--- |4.6.0
  Known to fail||4.5.3
 Resolution|--- |FIXED

--- Comment #6 from Andrew Pinski  ---
Fixed in GCC 4.6.0, there was many var_arg changes in GCC 4.6.0 that would have
fixed this.

[Bug target/42200] Suboptimal optimization: after x / 2 carry flag == x & 1

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

--- Comment #2 from Andrew Pinski  ---
GCC 8+ produces this for both:
cmpl$1, %edi
jbe .L1
testb   $1, %dil
je  .L4
.L1:
ret
.L4:
shrl%edi
jmp a

[Bug middle-end/40207] request for enhancement: delay argument loading until needed

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED
 Depends on||59299

--- Comment #3 from Andrew Pinski  ---
Fixed in GCC 5+ by r5-1146.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59299
[Bug 59299] We do not sink loads

[Bug tree-optimization/59299] We do not sink loads

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |5.0

[Bug target/39442] In some cases __builtin_ia32_loadups generates a movaps instruction

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   Keywords||wrong-code
  Known to fail||4.1.2
  Known to work||4.4.7, 4.5.3, 4.6.4, 4.7.1,
   ||4.9.1, 6.1.0
 Resolution|--- |FIXED
   Target Milestone|--- |4.4.0

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

[Bug target/22599] ICE with invalid asm usage

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #5 from Andrew Pinski  ---
Fixed back with r0-91401 for GCC 4.4.0.

[Bug target/101819] New: [12 Regression] ICE in expand_expr_real_2, at expr.c:9552 since r12-2789-gf31da42e047e8018ca6ad9809273bc7efb6ffcaf

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

Bug ID: 101819
   Summary: [12 Regression] ICE in expand_expr_real_2, at
expr.c:9552 since
r12-2789-gf31da42e047e8018ca6ad9809273bc7efb6ffcaf
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
CC: rguenth at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-linux-gnu
Target: riscv64-unknown-linux-gnu

The following fails:

$ ./xgcc -B.
/home/marxin/Programming/gcc/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c
-ftree-loop-vectorize -O1 -S
during RTL pass: expand
/home/marxin/Programming/gcc/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c:
In function ‘f2’:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c:24:10:
internal compiler error: in expand_expr_real_2, at expr.c:9552
   24 | d[i] = b[i] / 3;
  | ~^~
0xdd51c5 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/home/marxin/Programming/gcc2/gcc/expr.c:9552
0xdd91fb expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:10480
0xdd1573 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:8713
0xdb0813 expand_expr
/home/marxin/Programming/gcc2/gcc/expr.h:301
0xdd60ef expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/home/marxin/Programming/gcc2/gcc/expr.c:9780
0xdd91fb expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:10480
0xdd1573 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:8713
0xdb0848 expand_normal
/home/marxin/Programming/gcc2/gcc/expr.h:307
0xdcc54a store_field
/home/marxin/Programming/gcc2/gcc/expr.c:7439
0xdc8875 store_constructor_field
/home/marxin/Programming/gcc2/gcc/expr.c:6672
0xdcb9fe store_constructor
/home/marxin/Programming/gcc2/gcc/expr.c:7289
0xdd14b4 expand_constructor
/home/marxin/Programming/gcc2/gcc/expr.c:8634
0xddaad0 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:10819
0xdd1573 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:8713
0xdd923f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:10484
0xdd1573 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:8713
0xdc658f store_expr(tree_node*, rtx_def*, int, bool, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:6064
0xdc4e24 expand_assignment(tree_node*, tree_node*, bool)
/home/marxin/Programming/gcc2/gcc/expr.c:5796
0xc3a209 expand_gimple_stmt_1
/home/marxin/Programming/gcc2/gcc/cfgexpand.c:3945
0xc3a5fe expand_gimple_stmt
/home/marxin/Programming/gcc2/gcc/cfgexpand.c:4043
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/101812] [12 Regression] ICE: Segmentation fault (in ix86_expand_sse_movcc) since r12-731-gb1f7fd8a2a5558da

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

Uroš Bizjak  changed:

   What|Removed |Added

   Target Milestone|--- |12.0
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ubizjak at gmail dot com
Version|unknown |12.0

--- Comment #2 from Uroš Bizjak  ---
Patch in testing:

--cut here--
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 0984f7cc44d..2d3b63f0834 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -952,7 +952,7 @@
(set_attr "prefix" "orig,vex")
(set_attr "mode" "V4SF")])

-(define_insn "*mmx_v2sf3"
+(define_insn "v2sf3"
   [(set (match_operand:V2SF 0 "register_operand" "=x,x")
(any_logic:V2SF
  (match_operand:V2SF 1 "register_operand" "%0,x")
--cut here--

[Bug c++/80143] ICE on placement new in gimplify_init_ctor_eval, at gimplify.c:4436

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

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #4 from Martin Liška  ---
I think it was rather fixed in r8-7466-g3ec16e3610721403.

[Bug target/101812] [12 Regression] ICE: Segmentation fault (in ix86_expand_sse_movcc) since r12-731-gb1f7fd8a2a5558da

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

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org,
   ||uros at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-08-08
Summary|[12 Regression] ICE:|[12 Regression] ICE:
   |Segmentation fault (in  |Segmentation fault (in
   |ix86_expand_sse_movcc)  |ix86_expand_sse_movcc)
   ||since
   ||r12-731-gb1f7fd8a2a5558da
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed, started with r12-731-gb1f7fd8a2a5558da.

[Bug c++/94162] ICE [neg] bad return type in defaulted <=>

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

--- Comment #10 from Cameron  ---
(In reply to Andrew Pinski from comment #9)
> None of the testcases ICE in GCC 11+

I notice that if I change the repro to:

#include 

struct S {
  int a;
  int* operator<=>(const S&) const = default;
};

bool b = S{} < S{};


Notice the use of 'int*' as the comparison type.  GCC11 series will still
crash.

[Bug tree-optimization/33258] guaranteed-true arithmetic test not optimized away depending on constant

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Target Milestone|--- |10.0
  Component|rtl-optimization|tree-optimization
 Status|UNCONFIRMED |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=89518,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=33257
 Resolution|--- |FIXED

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

[Bug tree-optimization/33257] guaranteed-true test not optimized away when input values later used

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

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=89518
   Keywords||missed-optimization
 Resolution|--- |FIXED
  Known to fail||9.1.0
  Component|rtl-optimization|tree-optimization
  Known to work||10.1.0
 Status|UNCONFIRMED |RESOLVED

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

[Bug middle-end/23999] DECL_SIZE set to NULL at times

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
r10-2596 changed the documentation of DECL_SIZE to allow for null.

[Bug middle-end/8093] Wrong warning by gcc suggests adding dead code to end of function

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to fail||

--- Comment #5 from Andrew Pinski  ---
We have __builtin_unreachable() now, so maybe this is not as important.

[Bug tree-optimization/25623] jump threading/cfg cleanup messes up "incoming counts" for some BBs

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

Bug 26602 Summary: cfg cleanup can mess up incoming frequencies
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26602

   What|Removed |Added

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

[Bug tree-optimization/25623] jump threading/cfg cleanup messes up "incoming counts" for some BBs

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

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

[Bug tree-optimization/26602] cfg cleanup can mess up incoming frequencies

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug tree-optimization/25623] jump threading messes up "incoming frequencies" for some BBs

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2006-03-02 12:57:12 |2021-8-8
  Known to fail||4.4.7, 4.9.1, 5.1.0, 7.1.0

--- Comment #6 from Andrew Pinski  ---
For comment #1 in GCC 8+, the problem shows up in thread1:
;;   Invalid sum of incoming counts 332256647 (estimated locally), should be
365072220 (estimated locally)


On the trunk in thread1:
;;   basic block 6, loop depth 0, count 0 (precise), probably never executed
;;   Invalid sum of incoming counts 20359759 (estimated locally), should be 0
(precise)
;;prev block 5, next block 7, flags: (NEW, VISITED)
;;pred:   4 [never]  count:0 (precise) (TRUE_VALUE,EXECUTABLE)
;;5 [11.4% (guessed)]  count:20359759 (estimated locally)
(TRUE_VALUE,EXECUTABLE)
  # .MEM_16 = PHI <.MEM_11(4), .MEM_12(5)>
  # .MEM_8 = VDEF <.MEM_16>
  # USE = nonlocal 
  # CLB = nonlocal 
  abortD.1081 ();
;;succ:  

;;   basic block 7, loop depth 0, count 1073741824 (estimated locally), maybe
hot
;;   Invalid sum of incoming counts 1053382065 (estimated locally), should be
1073741824 (estimated locally)
;;prev block 6, next block 1, flags: (NEW, VISITED)
;;pred:   5 [88.6% (guessed)]  count:158087543 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
;;4 [always]  count:186624922 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
;;2 [66.0% (guessed)]  count:708669600 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
  # .MEM_9 = PHI <.MEM_12(5), .MEM_11(4), .MEM_4(D)(2)>
  # VUSE <.MEM_9>
  return;
;;succ:   EXIT [always]  count:1073741824 (estimated locally)
(EXECUTABLE)

[Bug c++/89062] class template argument deduction failure with parentheses

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

Patrick Palka  changed:

   What|Removed |Added

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

[Bug target/14839] configure does not check for the presence of 32bits libc with --disable-multilib

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |4.9.0
 Status|SUSPENDED   |RESOLVED

--- Comment #7 from Andrew Pinski  ---
r0-127201 fixed the x86_64-linux-gnu issue so closing.

[Bug middle-end/67619] ICE at -O1 and above on x86_64-linux-gnu in int_mode_for_mode, at stor-layout.c:425

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||jfc at mit dot edu

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

[Bug middle-end/36791] ICE with constant argument to __builtin_eh_return

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
This is a dup of bug 67619 which is fixed in GCC 4.9.4, GCC 5.3.0, and GCC 6+

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

[Bug c++/98101] ICE in mark_reachable_handlers, at tree-eh.c:4033

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

--- Comment #5 from Andrew Pinski  ---
(In reply to scott snyder from comment #3)
> Here's another example that crashes in the same place, but which doesn't use
> -fvtable-verify.  This example does use vectorization, and the ICE occurs
> only with -O3.  Seen with gcc  11.0.0 20201128.

This is a different bug and I can't reproduce it in a newer gcc 11.

[Bug middle-end/59507] ICE: in mark_reachable_handlers, at tree-eh.c:3833 with -O -fnon-call-exceptions -fvtable-verify=preinit

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||gs...@t-online.de

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

[Bug c++/98101] ICE in mark_reachable_handlers, at tree-eh.c:4033

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
Dup of bug 59507.

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

[Bug middle-end/59507] ICE: in mark_reachable_handlers, at tree-eh.c:3833 with -O -fnon-call-exceptions -fvtable-verify=preinit

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||Theodore.Papadopoulo@inria.
   ||fr

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

[Bug c++/101689] ICE with -fvtable-verify=std and -fnon-call-exceptions

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #7 from Andrew Pinski  ---
Dup of bug 59507.

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

[Bug middle-end/47011] ICE when using attribute optimize

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
Fixed so closing.

[Bug middle-end/28498] fstack-protector causes crash in combination with -Os

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to fail||
   Target Milestone|--- |4.4.7
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Andrew Pinski  ---
There is no way to reproduce this issue post 4.4.7. So closing

[Bug c++/95085] diagnostic on designated-initializer from braced-init-list could be better

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||hewillk at gmail dot com

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

[Bug c++/101818] Error message for the wrong name in designated initializers could be improved

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug c++/101537] -Wconversion false positive in ternary

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

Nikita Kniazev  changed:

   What|Removed |Added

 CC||nok.raven at gmail dot com

--- Comment #1 from Nikita Kniazev  ---
int foo(unsigned char x, bool f) {
x |= f ? 1 : 0; // warning
return x;
}

int bar(unsigned char x, bool f) {
x = x | f ? 1 : 0; // no warning
return x;
}

it also warns only for self-operators

[Bug c++/101818] New: Error message for the wrong name in designated initializers could be improved

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

Bug ID: 101818
   Summary: Error message for the wrong name in designated
initializers could be improved
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hewillk at gmail dot com
  Target Milestone: ---

Consider: https://godbolt.org/z/8xrocoTcG

struct Op { int a, b; };
Op op{.a = 0,
  .x = 0,


  .b = 0};


Clang rejects with:
:3:8: error: field designator 'x' does not refer to any field in type
'Op'
  .x = 0,
   ^
However, GCC rejects with:
:6:13: error: 'Op' has no non-static data member named 'x'
6 |   .b = 0};
  | ^


It would be less confusing and more user-friendly if the cursor can actually
point to the x.

[Bug c++/95455] ICE in capture with initializer in requires block

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

--- Comment #5 from Andrew Pinski  ---
Clang gives:
:5:16: error: reference to local variable 'foo' declared in enclosing
function 'f'
[bar = foo] {};
   ^
:3:9: note: 'foo' declared here
int foo;
^

[Bug c++/96442] [9/10/11/12 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954

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

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

[Bug c++/95955] ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

s/union/struct/ in the testcase in comment #0 and you will get exact testcase.

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

[Bug c++/95999] [9/10/11/12 Regression] ICE in tree check: expected integer_cst, have var_decl in get_len, at tree.h:5951

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |9.5
   Severity|normal  |trivial
Summary|ICE in tree check: expected |[9/10/11/12 Regression] ICE
   |integer_cst, have var_decl  |in tree check: expected
   |in get_len, at tree.h:5951  |integer_cst, have var_decl
   ||in get_len, at tree.h:5951

[Bug c++/94128] ICE on C++20 "requires requires" with lambda

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||dmusiienko at gmail dot com

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

[Bug c++/94333] ICE in tsubst_template_args at gcc/cp/pt.c:13074 ( when trying use structure binding in requires(requires{}))

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Dup of bug 94128.

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

[Bug c++/94333] ICE in tsubst_template_args at gcc/cp/pt.c:13074 ( when trying use structure binding in requires(requires{}))

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

--- Comment #2 from Andrew Pinski  ---
(In reply to Martin Liška from comment #1)
> Confirmed, started with r9-4045-g0c1e0d63fe0ceabb.
> Before that it was rejected with:
> 
> pr94333.cc:7:45: error: lambda-expression in unevaluated context
> 7 | static yes check(U u) requires(requires{[](auto u){auto [a, b] =
> u;}(u);});

Right because the lambda-expression in unevaluated context feature was not
supported before that patch :).

This code is valid and works with GCC 10.2.0 and 11+.

Note clang trunk ICEs on it.

[Bug c++/64924] Callback function passed as a parameter with typename declaration produces an ICE.

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||accepts-invalid

--- Comment #3 from Andrew Pinski  ---
Short testcase:
template
struct PP
{
PP(typename PP::gg n);
typedef void (T::*gg)(void);
};
template
PP::PP(gg n) {}
 CUT 
We also accept invalid code too:
template
struct PP
{
PP(typename PP::gg n);
typedef int gg;
};
template
PP::PP(gg n) {}

[Bug c/95124] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396

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

--- Comment #1 from Andrew Pinski  ---
Looks like this is fixed, I cannot even reproduce it with GCC 10.1.0.

  1   2   >