[Bug c/99317] Missed warning

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

--- Comment #1 from Andrew Pinski  ---
I dont think this is exactly a bug. The warning is a pedantic warning and with
void*, things are implicitly converted by standard c rules.

[Bug c/99322] [11 Regression] ICE in change_scope, at final.c:1480

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
   Keywords||openmp

[Bug target/99038] aarch64_rtx_costs is missing tests for vector immediate forms

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

[Bug c/99317] Missed warning

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

--- Comment #3 from Andrew Pinski  ---
Right.
basically what I am saying is:
x ? void* : char*
implies an implict conversion of the second operand to void*.
Without the cast, there is no implict conversion in standard C, that is what
the warning is about.
With -pendatic-errors, the warning turns into an error.

[Bug rtl-optimization/99346] [aarch64] ICE in gen_rtx_SUBREG, at emit-rtl.c:1021

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #1 from Andrew Pinski  ---
(In reply to Sebastian Pop from comment #0)
> Similar bug was reported/fixed on x86:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83723

I highly doubt it is related as that dealt with debug info and debug is
information is not turned on.

[Bug rtl-optimization/99346] [aarch64] ICE in gen_rtx_SUBREG, at emit-rtl.c:1021

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug middle-end/93235] [AArch64] ICE with __fp16 in a struct

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||spop at gcc dot gnu.org

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

[Bug rtl-optimization/99346] [aarch64] ICE in gen_rtx_SUBREG, at emit-rtl.c:1021

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

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> This is a dup of bug 93235.
I should note I reduced it to that bug report and looking at the
expand/optimized dumps to see it was also.

[Bug c++/99354] spurious Wuninitialized warning diagnostic

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This code violates C/C++ aliasing rules. Use memcpy or an union.

[Bug tree-optimization/99364] Regression: loops not optimized to count to 0/-1

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This is PR 22041.

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

[Bug tree-optimization/22041] Reverse loop order for increased efficiency

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||stefan at franke dot ms

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

[Bug middle-end/99370] calling a virtual function in insufficient space silently folded to __builtin_unreachable

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

--- Comment #1 from Andrew Pinski  ---
The problem is since this transformation is done during optimization, it could
be done on a path that is not executed at all.  This is why
-fsanitize=undefined/-fsanitize=unreachable should be used if you want to
detect it at runtime.

[Bug ipa/99373] unused static function not being removed in some cases after optimization

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
Summary|[missed optimization] dead  |unused static function not
   |code not eliminated from|being removed in some cases
   |short circuiting|after optimization
   Keywords||missed-optimization

[Bug target/99217] [MIPS] wrong function entry with -fpatchable-function-entry

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org

--- Comment #3 from Andrew Pinski  ---
(In reply to huang...@loongson.cn from comment #2)
> my colleague Xu Chenghua (xucheng...@loongson.cn) add a patch to address this

This patch is close, though it needs to move the call to
mips16_build_function_stub also.

[Bug middle-end/44262] va_list usage missed optimization.

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-03-04
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Keywords||missed-optimization
  Component|target  |middle-end

--- Comment #1 from Andrew Pinski  ---
Confirmed, the tail call is not even detected at the tree level.

[Bug target/99384] Unoptimized tailcall with char and short as parameter (x86)

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Dup of bug 95453.

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

[Bug target/95453] Failure to avoid useless sign extension

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||jonathan.poelen at gmail dot 
com

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

[Bug target/95453] Failure to avoid useless sign extension

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
This is a dup of bug 97607 which has the anlysis already.

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

[Bug target/97607] Spurious sign extension

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||gabravier at gmail dot com

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

[Bug target/97607] Spurious sign extension

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||mike.k at digitalcarbide dot 
com

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

[Bug target/93605] GCC suboptimal tail call optimization in trivial function forwarding with __attribute__((noinline))

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
Dup of bug 97607 which has the anlysis already.

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

[Bug c++/99393] Unoptimized tailcall with char and short as parameter (x86)

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Dup of bug 97607.

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

[Bug target/97607] Spurious sign extension

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||jonathan.poelen at gmail dot 
com

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

[Bug tree-optimization/99396] std::rotl and std::rotr do not invoke intrinsics, leading to serious performance issues

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|libstdc++   |tree-optimization
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-03-05

--- Comment #1 from Andrew Pinski  ---
return std::rotr(v,((unsigned int)t)&63);
Fixes the problem 
int a = std::abs(t);
a &= 63;
return std::rotr(v,a);

Also improves the situtation.
I am thinking the std::rotr could be rewritten or we could optimize this at the
tree level into the almost the intrinsics.
Note I think I Might have gotten the above incorrect a little bit.

[Bug tree-optimization/99396] std::rotl and std::rotr Does not convert into ROTATE on the gimple level

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

Andrew Pinski  changed:

   What|Removed |Added

Summary|std::rotl and std::rotr do  |std::rotl and std::rotr
   |not invoke intrinsics,  |Does not convert into
   |leading to serious  |ROTATE on the gimple level
   |performance issues  |
 Target|i386,x86_64. Does arm have  |
   |intrinsics for this?|
   Severity|normal  |enhancement
   Keywords||missed-optimization

[Bug tree-optimization/99396] std::rotl and std::rotr Does not convert into ROTATE on the gimple level

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

--- Comment #3 from Andrew Pinski  ---
(In reply to cqwrteur from comment #2)
> I would like to see __builtin_cpp_rotl and __builtin_cpp_rotr to allow more
> aggressive optimizations since rotl and rotr are so important for
> cryptography.

You don't need them.
The following code will already produce the rotate instruction:
auto f3(std::size_t v, int t)
{
  return (v<>(sizeof(v)*8 - t));
}

Note std::rotl/std::rotr has specific behavior dealing with 0 and negative
values and all.

[Bug target/99312] __ARM_ARCH is not implemented correctly when compiled with -march=armv8.1-a

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

--- Comment #3 from Andrew Pinski  ---
(In reply to ktkachov from comment #2)
> We intend to deprecate that macro going forward as it's not a useful way for
> testing architecture features in aarch64. It made sense in the pre-Armv7-a
> days, but now the recommended way to test for features is the __ARM_FEATURE*
> macros.

Which is interesting because x86 is going in the opposite direction and having
ISA "levels".

> 
> The scheme is also not very well-suited for things like the recent AArch64
> Armv8-R.
> 
> Is there a particular use case that you have in mind?

A customer was asking for how to detect the ISA Level at compile time and
runtime.

[Bug target/99312] __ARM_ARCH is not implemented correctly when compiled with -march=armv8.1-a

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

--- Comment #4 from Andrew Pinski  ---
ODP is one place where this is used:
https://opendataplane.github.io/odp/structodp__system__info__t.html

[Bug target/99312] __ARM_ARCH is not implemented correctly when compiled with -march=armv8.1-a

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

Andrew Pinski  changed:

   What|Removed |Added

URL||https://gcc.gnu.org/piperma
   ||il/gcc-patches/2021-March/5
   ||66322.html
   Keywords||patch

--- Comment #5 from Andrew Pinski  ---
Also Naveen posted a patch earlier today:
https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566322.html

[Bug target/99410] Nios II Error: branch offset out of range

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

--- Comment #1 from Andrew Pinski  ---
I think this is the same as
https://sourceware.org/bugzilla/show_bug.cgi?id=27243 .

[Bug target/99432] ICE in extract_constrain_insn, at recog.c:2670 when building libgcc for i686

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

Andrew Pinski  changed:

   What|Removed |Added

 Depends on||99422

--- Comment #1 from Andrew Pinski  ---
This is most likely a dup of bug 99422.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99422
[Bug 99422] [11 Regression] ICE in extract_constrain_insn building glibc
pthread_create

[Bug target/99434] std::bit_cast generates more instructions than __builtin_bit_cast and memcpy with -march=native

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
 Target||x86_64
   Keywords||missed-optimization, ra
  Component|tree-optimization   |target

--- Comment #1 from Andrew Pinski  ---
This is just a register allocation issue dealing with mulx and TImode.

If mulq was used instead (that is without -march=native), all of the functions
are done correctly.

[Bug target/99434] std::bit_cast generates more instructions than __builtin_bit_cast and memcpy with -march=native

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

--- Comment #3 from Andrew Pinski  ---
(In reply to cqwrteur from comment #2)
> (In reply to Andrew Pinski from comment #1)
> > This is just a register allocation issue dealing with mulx and TImode.
> > 
> > If mulq was used instead (that is without -march=native), all of the
> > functions are done correctly.
> 
> I do not think so. I think GCC generally did things like this wrong. I have
> even found out how to produce different wrong results deterministically.
> 
> For example like this
> https://godbolt.org/z/PbobYG
> 
> Any time it deals with things like >>32 or >>64, it produces a slower result.
> This even compiles without -march=native.

This is still a register allocation issue, this time dealing with DImode on
32bit. GCC has a known issue with register allocation when dealing with values
stored into two registers.  See PR 21150, PR 43644, PR 50339, etc.

[Bug target/99437] [11 Regression] Error: immediate value out of range 1 to 8 at operand 3 -- `shrn v1.8b,v1.8h,15'

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

Andrew Pinski  changed:

   What|Removed |Added

Summary|Error: immediate value out  |[11 Regression] Error:
   |of range 1 to 8 at operand  |immediate value out of
   |3 -- `shrn v1.8b,v1.8h,15'  |range 1 to 8 at operand 3
   ||-- `shrn v1.8b,v1.8h,15'
   Target Milestone|--- |11.0
   Keywords||assemble-failure
   Host|x86_64  |

--- Comment #2 from Andrew Pinski  ---
//(insn 148 147 149 (set (reg:V16QI 33 v1 [orig:153 _101 ] [153])
//(vec_concat:V16QI (truncate:V8QI (lshiftrt:V8HI (reg:V8HI 33 v1
[orig:165 _113 ] [165])
//(const_vector:V8HI [
//(const_int 15 [0xf]) repeated x8
//])))
//(const_vector:V8QI [
//(const_int 0 [0]) repeated x8
//])))
"/mnt/b/yoe/master/build/tmp/work/cortexa57-yoe-linux/opencv/4.5.1-r0/recipe-sysroot-native/usr/lib/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/include/arm_neon.h":6548:53
1917 {aarch64_shrnv8hi_insn_le}
// (nil))
shrnv1.8b, v1.8h, 15// 148  [c=4 l=4] 
aarch64_shrnv8hi_insn_le

Confirmed, reducing 

[Bug target/99437] [11 Regression] Error: immediate value out of range 1 to 8 at operand 3 -- `shrn v1.8b,v1.8h,15'

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Trying 144, 146 -> 148:
  144: r159:V8HI=r165:V8HI 0>>const_vector
  REG_DEAD r165:V8HI
  146: r155:V8QI=trunc(r159:V8HI)
  REG_DEAD r159:V8HI
  148: r153:V16QI=vec_concat(r155:V8QI,const_vector)
  REG_DEAD r155:V8QI
Successfully matched this instruction:
(set (reg:V16QI 153 [ _101 ])
(vec_concat:V16QI (truncate:V8QI (lshiftrt:V8HI (reg:V8HI 165 [ _113 ])
(const_vector:V8HI [
(const_int 15 [0xf]) repeated x8
])))
(const_vector:V8QI [
(const_int 0 [0]) repeated x8
])))

I have not reduced it yet but the above shows where the problem is introduced
inside combine.  I think the constrants/predicates for aarch64_shrnv8hi_insn_le
on the const_vect (shift) are incorrect.

[Bug target/98792] Fail to use SHRN instructions for narrowing shift on aarch64

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

Andrew Pinski  changed:

   What|Removed |Added

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

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


(insn 17 16 18 3 (set (reg:V8HI 109 [ vect__3.8 ])
(vec_concat:V8HI (truncate:V4HI (reg:V4SI 105 [ vect__2.7 ]))
(truncate:V4HI (reg:V4SI 107 [ vect__2.7 ] "t9.c":9:16 1942
{vec_pack_trunc_v4si}
 (expr_list:REG_DEAD (reg:V4SI 107 [ vect__2.7 ])
(expr_list:REG_DEAD (reg:V4SI 105 [ vect__2.7 ])
(nil
(insn 18 17 19 3 (set (mem:V8HI (post_inc:DI (reg:DI 92 [ ivtmp.16 ])) [2 MEM
 [(short unsigned int *)_7]+0 S16 A128])
(reg:V8HI 109 [ vect__3.8 ])) "t9.c":9:16 1161 {*aarch64_simd_movv8hi}
 (expr_list:REG_DEAD (reg:V8HI 109 [ vect__3.8 ])
(expr_list:REG_INC (reg:DI 92 [ ivtmp.16 ])
(nil
Part of the problem is the above. 
So this might need to be done at the gimple level such that we don't do the
vec_concat in the first place 
That is if we had the RTL for:
ushrv1.4s, v1.4s, 3
ushrv0.4s, v0.4s, 3
xtn v2.4h, v1.4s
xtn v3.8h, v0.4s
str d3, d2, [x1], 16
I think combine would have done its job.

[Bug target/99312] __ARM_ARCH is not implemented correctly when compiled with -march=armv8.1-a

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #6 from Andrew Pinski  ---
Confirmed, Naveen posted the patch already.

[Bug middle-end/99370] calling a virtual function in insufficient space silently folded to __builtin_unreachable

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug target/99195] Optimise away vec_concat of 64-bit AdvancedSIMD operations with zeroes in aarch64

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

[Bug target/99432] ICE in extract_constrain_insn, at recog.c:2670 when building libgcc for i686

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Dup in the end.

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

[Bug target/99422] [11 Regression] ICE in extract_constrain_insn building glibc pthread_create

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||italolmm2018 at outlook dot com

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

[Bug bootstrap/99438] [11 regression] libgcc/soft-fp/divtf3.c:51:1: error: unrecognizable insn

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Dup of bug 99422.

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

[Bug target/99422] [11 Regression] ICE in extract_constrain_insn building glibc pthread_create

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||gerald at pfeifer dot com

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

[Bug middle-end/98865] Missed transform of (a >> 63) * b

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

[Bug debug/95431] inconsistent behaviors at -O2

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

--- Comment #2 from Andrew Pinski  ---
Looks correct at the gimple level:
  [t.c:6:3] # DEBUG BEGIN_STMT
  [t.c:6:16] one.0_1 ={v} one;
  [t.c:6:16] _2 = (char) one.0_1;
  [t.c:6:8] a1[0] = _2;
  [t.c:6:8] MEM  [(char *)&a1 + 1B] = 770;
  [t.c:6:8] a1[3] = 4;

  [t.c:7:3] # DEBUG BEGIN_STMT
  [t.c:7:8] a2[0] = 1;
  [t.c:7:19] one.1_3 ={v} one;
  [t.c:7:19] _4 = (unsigned char) one.1_3;
  [t.c:7:19] _5 = _4 * 2;
  [t.c:7:19] _6 = (char) _5;
  [t.c:7:8] a2[1] = _6;
  [t.c:7:8] MEM  [(char *)&a2 + 2B] = 1027;

  [t.c:8:3] # DEBUG BEGIN_STMT
  [t.c:8:31] one.2_7 ={v} one;
  [t.c:8:31] _8 = one.2_7 + 5;
  [t.c:8:13] _9 = (long unsigned int) _8;
  [t.c:8:13] res_19 = memcmp ([t.c:8:21] &a1, [t.c:8:25] &a2, _9);
  [t.c:8:13] # DEBUG res => res_19
  [t.c:9:3] # DEBUG BEGIN_STMT

Assembly:
.loc 1 6 3 view .LVU1
.loc 1 5 12 is_stmt 0 view .LVU2
subq$24, %rsp
.cfi_def_cfa_offset 32
.loc 1 6 16 view .LVU3
movlone(%rip), %eax
.loc 1 7 8 view .LVU4
movl$1027, %edx
movw%dx, 14(%rsp)
.loc 1 8 13 view .LVU5
leaq12(%rsp), %rsi
leaq8(%rsp), %rdi
.loc 1 6 16 view .LVU6
movb%al, 8(%rsp)
.loc 1 6 8 view .LVU7
movl$770, %eax
movw%ax, 9(%rsp)
.loc 1 7 19 view .LVU8
movlone(%rip), %eax
.loc 1 8 31 view .LVU9
movlone(%rip), %edx
.loc 1 6 8 view .LVU10
movb$4, 11(%rsp)
.loc 1 7 3 is_stmt 1 view .LVU11
.loc 1 8 3 view .LVU12
.loc 1 7 19 is_stmt 0 view .LVU13
addl%eax, %eax
.loc 1 7 8 view .LVU14
movb$1, 12(%rsp)
.loc 1 8 31 view .LVU15
addl$5, %edx
.loc 1 7 19 view .LVU16
movb%al, 13(%rsp)
.loc 1 8 13 view .LVU17
movslq  %edx, %rdx


This could be a gdb issue because what GCC produces look correct.

[Bug debug/95432] inconsistent behaviors at -O2

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

--- Comment #2 from Andrew Pinski  ---
Assembly:
.loc 1 12 3 is_stmt 1 view .LVU12
.loc 1 10 8 is_stmt 0 view .LVU13
movaps  %xmm0, (%rsp)
.loc 1 11 8 view .LVU14
movaps  %xmm0, 32(%rsp)
.loc 1 12 13 view .LVU15
callfoo
.LVL1:
.loc 1 13 13 view .LVU16
leaq32(%rsp), %rdi
.loc 1 12 13 view .LVU17
movl%eax, %edx
.LVL2:
.loc 1 13 3 is_stmt 1 view .LVU18
.loc 1 13 13 is_stmt 0 view .LVU19
callfoo
.LVL3:
.loc 1 14 3 is_stmt 1 view .LVU20
.loc 1 14 6 is_stmt 0 view .LVU21

Looks correct to me, both call foo have the correct line on them.  I think this
is another GDB issue, most likely how dwarf3 and is_stmt is handled just like
95431 even.

[Bug rtl-optimization/95405] Unnecessary stores with std::optional

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
 Ever confirmed|0   |1
   Last reconfirmed||2021-03-07
  Component|tree-optimization   |rtl-optimization
 Target||x86_64-linux-gnu
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
On aarch64 we do the correct thing:
_Z3barv:
stp x29, x30, [sp, -32]!
mov x29, sp
bl  _Z3foov
tst w1, 255
cselx0, x0, xzr, ne
ldp x29, x30, [sp], 32
ret

So this is most likely an issue with how x86_64 implements stuff.

Confirmed for x86_64 though.

[Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"

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

--- Comment #1 from Andrew Pinski  ---
I think this is expected behavior. Aborting should not dump the coverage file
at all as it should be used for an really bad unexitable situation only.

[Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"

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

--- Comment #2 from Andrew Pinski  ---
This behavior might even be documented but I have not looked yet.

[Bug gcov-profile/99442] [GCOV] No coverage with "Segmentation fault (core dumped)"

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

--- Comment #1 from Andrew Pinski  ---
There is no way really to recover from a segfault in a manner that is suitable
for all programs. The developer could set a sigv handler if they want to do any
recovery from it. The library should not do it.

[Bug gcov-profile/99441] [GCOV] Wrong coverage with complex "if" condition

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

--- Comment #1 from Andrew Pinski  ---
So line 27 has a short cutting conditional included, so technically it is
executed 30 times, one for each side of the &&.

[Bug lto/99447] [11 Regression] ICE (segfault) in lookup_page_table_entry

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

--- Comment #2 from Andrew Pinski  ---
Looks like a stack overflow while doing gc. To me die_struct GTY could use a
recursive note added to it. That is just by looking at the backtrace.

[Bug debug/95432] inconsistent behaviors at -O2

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |MOVED

--- Comment #4 from Andrew Pinski  ---
Closing as moved as it was reported and fixed in gdb already.

[Bug c/99454] internal compiler error: kernel module tg3 tg3_start_xmit

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug target/99422] [11 Regression] ICE in extract_constrain_insn building glibc pthread_create

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||raj.khem at gmail dot com

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

[Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"

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

--- Comment #4 from Andrew Pinski  ---
It is not well documented though.
https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Gcov-and-Optimization.html#Gcov-and-Optimization
Long-running applications can use the __gcov_reset and __gcov_dump facilities
to restrict profile collection to the program region of interest. Calling
__gcov_reset(void) will clear all profile counters to zero, and calling
__gcov_dump(void) will cause the profile information collected at that point to
be dumped to .gcda output files. ** Instrumented applications use a static
destructor with priority 99 to invoke the __gcov_dump function.** Thus
__gcov_dump is executed after all user defined static destructors, as well as
handlers registered with atexit. If an executable loads a dynamic shared object
via dlopen functionality, -Wl,--dynamic-list-data is needed to dump all profile
data.

- CUT 

[Bug c/99455] internal compiler error: In function 'prb_reserve_in_last' in linux kernel

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Dup of bug 99422.

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

[Bug target/99422] [11 Regression] ICE in extract_constrain_insn building glibc pthread_create

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

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

[Bug c++/99456] [11 regression] ABI breakage with some static initialization

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ABI
   Target Milestone|--- |11.0

[Bug debug/99457] gcc/gdb -gstabs+ is buggy.

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

--- Comment #1 from Andrew Pinski  ---
stabs support really should be removed.

[Bug debug/99457] gcc/gdb -gstabs+ is buggy.

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

--- Comment #2 from Andrew Pinski  ---
https://gcc.gnu.org/pipermail/gcc-patches/2017-July/479552.html

[Bug rtl-optimization/99467] [11 Regression] ICE in lra_set_insn_recog_data, at lra.c:1006 since r11-7526-g9105757a59b89019

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

Andrew Pinski  changed:

   What|Removed |Added

Version|unknown |11.0
   Target Milestone|--- |11.0

[Bug rtl-optimization/99470] Convert fixed index addition to array address offset

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

--- Comment #1 from Andrew Pinski  ---
these two code are not equivalent at all due to overflows and such.

[Bug rtl-optimization/99470] Convert fixed index addition to array address offset

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
These functions have the same code gen though:
inline signed char arr[256];

bool f(unsigned long a, unsigned long b) {
return arr[a+128] == arr[b+128];
}

bool g(unsigned long a, unsigned long b) {
return (arr+128)[a] == (arr+128)[b];
}

- CUT -
The reason why int is not equivalent because signed integer overflow is
undefined plus doing the math in 64bit or 32bit would cause a huge difference
in some cases.

[Bug rtl-optimization/99470] Convert fixed index addition to array address offset

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

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> The reason why int is not equivalent because signed integer overflow is
> undefined plus doing the math in 64bit or 32bit would cause a huge
> difference in some cases.
The cases is if a/b are negative.

[Bug tree-optimization/99473] redundant conditional zero-initialization not eliminated

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
Confirmed, I think there are other bugs dealing with this same thing.
g3 should have been caught by cstore but I don't see why it is not.
Also g2 needs commoning by sinking rather commoning by pulling.

[Bug debug/99334] Generated DWARF unwind table issue while on instructions where rbp is pointing to callers stack frame

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |8.2
 Status|WAITING |RESOLVED

--- Comment #3 from Andrew Pinski  ---
so clsoing as fixed as GCC 7.x (and before) are no longer supported.

[Bug target/99491] [mips64] over-strict refusal to emit tail calls

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug target/99548] Help me! Lost the fight against the compiler.

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|rtl-optimization|target

--- Comment #1 from Andrew Pinski  ---
For aarch64 we get:
ldp x4, x3, [x1]
mov x7, 38
ldp x6, x5, [x2]
ldr x8, [x1, 16]
add x6, x4, x6
cmp x4, x6
adc x5, x3, x5
cmp x3, x5
ldr x3, [x1, 24]
ldp x4, x1, [x2, 16]
adc x4, x8, x4
cmp x8, x4
adc x1, x3, x1
cmp x3, x1
csetm   x2, cs
and x2, x2, x7
add x2, x2, x6
cmp x2, x6
cincx6, x5, ls
cmp x6, x5
cincx5, x4, ls
cmp x5, x4
cincx3, x1, ls
cmp x3, x1
csetm   x1, ls
and x1, x1, x7
add x1, x1, x2
str x1, [x0]
cmp x1, x2
cincx1, x6, ls
str x1, [x0, 8]
cmp x1, x6
cincx1, x5, ls
cmp x1, x5
cincx3, x3, ls
stp x1, x3, [x0, 16]
ret
There is only one missing optimization there really:
csetm   x1, ls
and x1, x1, x7
Should be turned into:
csel x1, x7, xzw, ls
Which is repeated a few times.

It looks like x86_64 has other issues.

[Bug lto/99559] LTO with -Os -ffreestanding -nodefaultlibs may generate call to memcpy, but fail linking even though memcpy is defined

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

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug lto/58203] memset/memcpy are discarded with -flto

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||kabel at blackhole dot sk

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

[Bug middle-end/99579] gmon.out not created with -O0 but otherwise is

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |WORKSFORME
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
GCC is emitting the mcount call correctly for each function.
Glibc is the library where the mcount is located and enabling of the timer
(SIGPROF) is enabled and it controls the outputting of the gmon.out.
>From what I can tell if the timer does not happen, then there will be no
gmon.out outputted.
With a slower/older machine (AMD Athlon(tm) II X4 640 Processor), I sometimes
get gmon.out and sometimes don't.

[Bug middle-end/99608] gcc doesn't print diagnostics carets when file is passed through stdin

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
  Component|driver  |middle-end
 Resolution|--- |WONTFIX

--- Comment #1 from Andrew Pinski  ---
This is done on purpose.  It is based on the original file, rather than the
preprocessed source or otherwise.  With stdin, there is no original file being
referenced.

[Bug middle-end/99619] fails to infer local-dynamic TLS model from hidden visibility

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug target/99620] Subtract with borrow (SBB) missed optimization

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|rtl-optimization|target
   Keywords||missed-optimization
   Severity|normal  |enhancement

[Bug target/99620] Subtract with borrow (SBB) missed optimization

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

Andrew Pinski  changed:

   What|Removed |Added

 Target||x86_64-linux-gnu

--- Comment #1 from Andrew Pinski  ---
This works on aarch64:
_Z8sub_good4u128S_:
.LFB0:
.cfi_startproc
subsx0, x0, x2
sbc x1, x1, x3
ret
.
_Z7sub_bad4u128S_:
.LFB1:
.cfi_startproc
subsx0, x0, x2
sbc x1, x1, x3
ret

[Bug target/99621] [8,9,10,11 REGRESSION] [bisected to 058e97ecf33ad0dfd926b3876a4bcf59ac9556ff] regression with -m32 -O1 -fcaller-saves -fexpensive-optimizations

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

Andrew Pinski  changed:

   What|Removed |Added

Summary|[5-11 REGRESSION] [bisected |[8,9,10,11 REGRESSION]
   |to  |[bisected to
   |058e97ecf33ad0dfd926b3876a4 |058e97ecf33ad0dfd926b3876a4
   |bcf59ac9556ff] regression   |bcf59ac9556ff] regression
   |with -m32 -O1   |with -m32 -O1
   |-fcaller-saves  |-fcaller-saves
   |-fexpensive-optimizations   |-fexpensive-optimizations
   Target Milestone|--- |8.5

[Bug tree-optimization/99632] missing warning accessing a trailing zero length array member of base class

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

--- Comment #1 from Andrew Pinski  ---
The code is chopped off and does not declare the struct B.

[Bug target/99639] New: Duplicated constant in V2SI/V4SI

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

Bug ID: 99639
   Summary: Duplicated constant in V2SI/V4SI
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: enhancement
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take C++ code:
void  foo(int (&arr)[42])
{
for (unsigned i = 0; i < sizeof(arr) / sizeof(arr[0]); ++i)
arr[i] = 43;
}
 CUT 
Current we produce:
foo(int (&) [42]):
moviv0.4s, 0x2b
moviv1.2s, 0x2b
stp q0, q0, [x0]
stp q0, q0, [x0, 32]
stp q0, q0, [x0, 64]
stp q0, q0, [x0, 96]
stp q0, q0, [x0, 128]
str d1, [x0, 160]
ret
- CUT 
But d1 is the same as q0 really.  And we don't need to have it.

[Bug c/99649] GDB has issue to show backtrace if the breakpoint is in a function with more then 8 parameters - only for target aarch64-elf ILP32

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

--- Comment #1 from Andrew Pinski  ---
Gdb support for ilp32 has never been committed so I dont see how you are using
it.

[Bug target/99652] inline doesn't with -mno-sse

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
I don't see why this is a bug. GCC decides the return register early on and
that is a good thing.

[Bug c++/99677] [[gnu::const]] attribute does not prevent dead global variable gets emitted.

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

--- Comment #3 from Andrew Pinski  ---
I think this is a dup of bug 99456.

[Bug middle-end/99689] Initialized local variable becomes uninitialized after use

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |middle-end
   Keywords||wrong-code

--- Comment #2 from Andrew Pinski  ---
Works for me on the trunk:
GNU C++17 (GCC) version 11.0.1 20210314 (experimental) [master revision
553488851dd:9748870ecd0:87cbac2b7a78fdfda61a6accf13a1fd858f5ccfe]
(aarch64-unknown-linux-gnu)

[Bug libstdc++/99692] Lookup for operator<< skips global scope

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |libstdc++

--- Comment #1 from Andrew Pinski  ---
Right the problem is here (and not with the compiler itself if there is a
problem):
/home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:747:46: error: no match
for ‘operator<<’ (operand types are ‘std::basic_ostream’ and ‘const
std::vector’)
  746 |__void_t()
  |  
  747 |  << declval())>>
  |  ^~~~


But by definition at this point operator << does not exist and is not
considered as it is not found via ADL because both std::basic_ostream and
std::vector are in the std namespace and the global namespace is not
considered.

/home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:773:5:   required by
substitution of ‘template typename
std::enable_if >,
std::__is_convertible_to_basic_ostream<_Ostream>, std::__is_insertable::__ostream_type, const _Tp&, void>
>::value, typename
std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type>::type
std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = CustomStream; _Tp =
std::vector]’
t78.cc:21:41:   required from here
  template
inline
typename enable_if<__and_<__not_>,
  __is_convertible_to_basic_ostream<_Ostream>,
  __is_insertable<
__rvalue_ostream_type<_Ostream>,
const _Tp&>>::value,
   __rvalue_ostream_type<_Ostream>>::type
operator<<(_Ostream&& __os, const _Tp& __x)

It is the __is_insertable in the above.
So it might be the wrong type being used to check __is_insertable 

[Bug libstdc++/99692] Lookup for operator<< skips global scope

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

--- Comment #2 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #1)
> Right the problem is here (and not with the compiler itself if there is a
> problem):
> /home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:747:46: error: no match
> for ‘operator<<’ (operand types are ‘std::basic_ostream’ and ‘const
> std::vector’)
>   746 |__void_t()
>   |  
>   747 |  << declval _Tp&>())>>
>   |  ^~~~
> 
> 
> But by definition at this point operator << does not exist and is not
> considered as it is not found via ADL because both std::basic_ostream
> and std::vector are in the std namespace and the global namespace is
> not considered.
> 
> /home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:773:5:   required by
> substitution of ‘template typename
> std::enable_if >,
> std::__is_convertible_to_basic_ostream<_Ostream>,
> std::__is_insertable std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type, const _Tp&,
> void> >::value, typename
> std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type>::type
> std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = CustomStream; _Tp =
> std::vector]’
> t78.cc:21:41:   required from here
>   template
> inline
> typename enable_if<__and_<__not_>,
>   __is_convertible_to_basic_ostream<_Ostream>,
>   __is_insertable<
> __rvalue_ostream_type<_Ostream>,
> const _Tp&>>::value,
>__rvalue_ostream_type<_Ostream>>::type
> operator<<(_Ostream&& __os, const _Tp& __x)
> 
> It is the __is_insertable in the above.
> So it might be the wrong type being used to check __is_insertable 

If anything it is the __rvalue_ostream_type<_Ostream> part if I am reading this
code correctly.

[Bug c/99693] -O2 not move 'if' checks on const data outside the loops

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

--- Comment #2 from Andrew Pinski  ---
Loop unswitching is correctly only turned on at -O3+. So you want to move it to
-O2. Note loop unswitching can cause performance problems due to increase of
usage of the icache and such.

[Bug target/99698] [aarch64] Impossible to accurately detect extensions using preprocessor

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

--- Comment #1 from Andrew Pinski  ---
>AFAICT there is no way to reliably detect armv8.2-a. 

There is supposed to be   See PR 99312 .

[Bug target/99706] [11 Regression] ICE: maximum number of generated reload insns per insn achieved (90)

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
 CC||pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
Thos are some interesting options.  How did you decide to use them?

Note the options used here are unrelated to the ICE though.

[Bug target/99706] [11 Regression] ICE: maximum number of generated reload insns per insn achieved (90)

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
It is this RTL which is causing the issue:
(insn 31 27 29 4 (set (reg:V2DI 125 [ ivtmp.27 ])
(subreg:V2DI (reg/f:DI 31 sp) 0)) 1163 {*aarch64_simd_movv2di}
 (expr_list:REG_DEAD (reg:TI 32 v0)
(nil)))

Which was created while expanding (well sp is not there right away, it is done
later on):
  _42 = (sizetype) buf.1_10;
  _43 = _42 + 1;
  _44 = {_42, _43};

[Bug c/99707] missing -Woverflow warning in floating-point to integer conversion for known but non-constant value

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

--- Comment #1 from Andrew Pinski  ---
Gcc does not know that x will be negative. 

Note: x == -1.0 is well defined. As x is converted to double from unsigned int.

-Wconversion might warn about this but I have not tried.

[Bug c/99707] missing -Woverflow warning in floating-point to integer conversion for known but non-constant value

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

--- Comment #2 from Andrew Pinski  ---
Also this might be caught at runtime with -fsanitizer=undefined but I have not
tried yet. Since this is undefined behavior in this case unlike the original
PR93806.

[Bug c/99707] missing -Woverflow warning in floating-point to integer conversion for known but non-constant value

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

--- Comment #4 from Andrew Pinski  ---
The front end does not normally do constant prop if the variable is not a
const/constexpr so the warning would be done in the middle end and might have
false warnings so it might not be useful.

[Bug target/99706] [10/11 Regression] ICE: maximum number of generated reload insns per insn achieved (90)

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

Andrew Pinski  changed:

   What|Removed |Added

Version|11.0|10.1.0
Summary|[11 Regression] ICE:|[10/11 Regression] ICE:
   |maximum number of generated |maximum number of generated
   |reload insns per insn   |reload insns per insn
   |achieved (90)   |achieved (90)
  Known to work||7.3.0, 7.4.0
  Known to fail||10.0, 11.0
   Target Milestone|11.0|10.3

--- Comment #6 from Andrew Pinski  ---
Here is a testcase which fails at -O1 (without any other options) and above:
int kk;

typedef unsigned long long v2di __attribute__((vector_size(16) ));

void f(v2di);

void
ii (int BUFSIZE)
{
  char buf[BUFSIZE], *ptr = buf;
  int i;
  unsigned long t = (unsigned long)buf;
  v2di tt = {t, t+1};
  f(tt);
}
- CUT 
This worked in GCC 7.3.0 and 7.4.0 but fails with 10.1.0 and above.  I don't
have 9.x to test on though.

[Bug c++/69549] Named Address Spaces does not compile in C++

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

--- Comment #6 from Andrew Pinski  ---
(In reply to Thiago Macieira from comment #5)
> BTW, Clang solved this by making __seg_fs, __seg_gs macros that resolve to
> __attribute__:

> That way, they don't need to be deduced as qualifiers in C, like const,
> volatile and _Atomic.

You still need to handle the attribute like qualifiers 

> So this compiles with Clang in C++:
> 
> void *tid() { auto tib = (void * __seg_fs*)(0); return *tid; }

The above is not the reason why namespaces are not handled in GCC's C++
front-end.  The reason why they are not handled in C++ is because you need to
handle them in overloads and templates correctly.  Does clang handle those
correctly or does it ignore that issue?

[Bug middle-end/99736] Statement expression (gcc extension) cannot return struct with variable length array

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE
Summary|Statement expression (gcc   |Statement expression (gcc
   |extension) cannot return|extension) cannot return
   |struct (with variable   |struct with variable length
   |length array) object|array
   Keywords||ice-on-valid-code
  Component|c   |middle-end

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

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

[Bug c/29970] mixing ({...}) with VLA leads to massive breakage

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||tunagul29 at icloud dot com

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

[Bug c/99779] [GCC-10.1.0]A bug when assign to a pointer by function which process the pointer inside.

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
In C, it is unspecified which side of the equal gets evaluated first.
So in this case (*fp = foo();):
this could be done as
int *fpp = fp;
*fpp = foo();
OR:
int t = foo();
*fp = t;

BOTH are valid for C.
C++11 and above have different rules with respect to sequence points.

[Bug c/99784] `labels as values`can point to the wrong spot after optimization

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Dup of bug 96956.  This is undefined.  See PR 96956 for the reason why.

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

gcc-bugs@gcc.gnu.org

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||mh+gcc at glandium dot org

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

[Bug c++/99785] Awful lot of time spent building gl.cc in Firefox

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

--- Comment #1 from Andrew Pinski  ---
-O0 -ftime-report:
 callgraph ipa passes   :   6.16 ( 19%)   0.94 ( 20%)   7.10 ( 19%)
   62M (  6%)

(NOTE this is the trunk with checking enabled and not GCC built with
--enable-checking=release).

  1   2   3   4   5   6   7   8   9   10   >