[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #1 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #0) > Since https://reviews.llvm.org/D99790 Clang optimizes it: Oops, I meant to paste this, from clang 13.0.0 at -O1 f(int&): #

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #2 from Jonathan Wakely --- https://godbolt.org/z/8aMc14qfW

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 Jakub Jelinek changed: What|Removed |Added CC||aldyh at gcc dot gnu.org,

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #4 from Jonathan Wakely --- Oops more slip-ups in the original submission .. (In reply to Jonathan Wakely from comment #0) > Although an int* might not actually point to a valid int, and so could be > misaligned, and int& must be bo

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #5 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #3) > I'm not sure if we can rely on this for non-C++ FEs though, so perhaps a > langhook that we use during evrp on (D) SSA_NAME of PARM_DECLs and ask the > FE whet

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #6 from Richard Biener --- Is the case important enough to worry about? Actual accesses will be assumed to be aligned according to the type. But sure, we could in theory special-case REFERENCE_TYPE in CCP. Does any other frontend

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #7 from Jonathan Wakely --- (In reply to Richard Biener from comment #6) > Is the case important enough to worry about? I have no idea, I just noticed that clang is doing this and we aren't. I doubt it's very important.

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #8 from Jakub Jelinek --- (In reply to Richard Biener from comment #6) > Is the case important enough to worry about? Actual accesses will be > assumed to be aligned according to the type. > > But sure, we could in theory special-c

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #9 from rguenther at suse dot de --- On Thu, 25 Nov 2021, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 > > --- Comment #8 from Jakub Jelinek --- > (In reply to Richard Biener from comment #

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 --- Comment #10 from Jonathan Wakely --- int*& is a reference to a pointer, and is perfectly valid. You can't have a pointer to a reference (a reference isn't required to have any storage, so taking the address of a reference doesn't make sense

[Bug tree-optimization/103427] Alignment of C++ references and 'this' pointer not used by optimizer

2021-11-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103427 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2021-11-25 Ever confirmed|0