[Bug d/97843] Bad code gen when concatenating to array

2020-11-18 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #9 from Iain Buclaw --- Another related issue has been created in pr97889.

[Bug d/97843] Bad code gen when concatenating to array

2020-11-18 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 Iain Buclaw changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug d/97843] Bad code gen when concatenating to array

2020-11-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #7 from CVS Commits --- The releases/gcc-10 branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:bbb887834d78cf6a444bf9cecc29d14b4dfb9cf8 commit r10-9043-gbbb887834d78cf6a444bf9cecc29d14b4dfb9cf8 Author: Iain Buclaw Date:

[Bug d/97843] Bad code gen when concatenating to array

2020-11-16 Thread alex at sunopti dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #6 from Alex --- >From cppreference.com : The behavior of every builtin compound-assignment expression E1 op= E2 (where E1 is a modifiable lvalue expression and E2 is an rvalue expression or a braced-init-list (since C++11)) is exact

[Bug d/97843] Bad code gen when concatenating to array

2020-11-16 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #5 from Iain Buclaw --- (In reply to Alex from comment #2) > The arithmetic equivalent would be for: > X += 4/2 > To be produce: > Immediate load Register with 4 > Add register with 4 in it to x > Divide register with 4 in it by 2 > R

[Bug d/97843] Bad code gen when concatenating to array

2020-11-16 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #4 from Iain Buclaw --- Might be a regression caused by the fix for PR96924

[Bug d/97843] Bad code gen when concatenating to array

2020-11-16 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #3 from Iain Buclaw --- (In reply to Alex from comment #2) > I agree that the order of evaluation of operands is undefined and writing > code that depends on that order would not be reliable. In this case it's the > execution of the a

[Bug d/97843] Bad code gen when concatenating to array

2020-11-16 Thread alex at sunopti dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #2 from Alex --- I agree that the order of evaluation of operands is undefined and writing code that depends on that order would not be reliable. In this case it's the execution of the assign expression happening before all the operan

[Bug d/97843] Bad code gen when concatenating to array

2020-11-16 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97843 --- Comment #1 from Iain Buclaw --- (In reply to Alex from comment #0) > This code: > > import std.stdio; > > ubyte sum(ubyte[] bytes) > { > ubyte result; > foreach(x;bytes) > result += x; > return result; > } >