[Bug c++/53707] compiler generates wrong code

2012-07-04 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 Richard Guenther changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|

[Bug c++/53707] compiler generates wrong code

2012-07-03 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #18 from Mikael Pettersson 2012-07-03 15:04:56 UTC --- Right, I understood that the C test case invoked implementation-defined behaviour, but inlining does invalidate any assumptions it might have made. Attaching an "__attribute__((_

[Bug c++/53707] compiler generates wrong code

2012-07-03 Thread sch...@linux-m68k.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #17 from Andreas Schwab 2012-07-03 14:05:06 UTC --- When the call to find_stack_direction is inlined into itself there is no requirement on how the two instances of here are allocated, so their addresses have no defined relative order

[Bug c++/53707] compiler generates wrong code

2012-07-03 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #16 from Andrew Pinski 2012-07-03 13:09:01 UTC --- The code as written might be considered as undefined.

[Bug c++/53707] compiler generates wrong code

2012-07-03 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #15 from Mikael Pettersson 2012-07-03 09:56:33 UTC --- Created attachment 27734 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27734 cleaned up test case This cleaned up version of the small C test case should be free of any tec

[Bug c++/53707] compiler generates wrong code

2012-07-02 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #14

[Bug c++/53707] compiler generates wrong code

2012-07-02 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #13 from Rafał Mużyło 2012-07-02 20:25:12 UTC --- As I said, it might not be related, but it's a bit odd, that both gcc versions agree *and* it's also about inlining.

[Bug c++/53707] compiler generates wrong code

2012-07-02 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 Mikael Pettersson changed: What|Removed |Added CC||mikpe at it dot uu.se --- Comment #12

[Bug c++/53707] compiler generates wrong code

2012-07-02 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #11 from Rafał Mużyło 2012-07-02 19:38:29 UTC --- OK, I don't know if it's related, but https://bugs.gentoo.org/show_bug.cgi?id=424475 and its follow-up http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11845 This code: int find_stack_di

[Bug c++/53707] compiler generates wrong code

2012-06-18 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #10 from Rafał Mużyło 2012-06-18 11:13:20 UTC --- Now, for an interesting note: if instead of 'string test(n);' I put 'printf("%d\n", n);', not only the bug *still* happens, but the result if funny: first a '0' gets printed, but after

[Bug c++/53707] compiler generates wrong code

2012-06-18 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #9 from Rafał Mużyło 2012-06-18 10:43:50 UTC --- The code is not mine and it's about as convoluted (if not more) as freeciv was (that was the *initial* part of bug 39333 - the upstream workaround was http://svn.gna.org/viewcvs/freeciv

[Bug c++/53707] compiler generates wrong code

2012-06-18 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #8 from Richard Guenther 2012-06-18 10:04:36 UTC --- Btw, when removing the 'string test(n)' line the function gets inlined and eliminated, so that is not of much help.

[Bug c++/53707] compiler generates wrong code

2012-06-18 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #7 from Richard Guenther 2012-06-18 09:58:58 UTC --- (In reply to comment #6) > (In reply to comment #5) > > The wrong code here seems to be 'n' treated as a constant - there was a bug > > (regarding freeciv, IIRC) of a similar case f

[Bug c++/53707] compiler generates wrong code

2012-06-18 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #6 from Richard Guenther 2012-06-18 09:58:04 UTC --- (In reply to comment #5) > The wrong code here seems to be 'n' treated as a constant - there was a bug > (regarding freeciv, IIRC) of a similar case for an older gcc version. > > A

[Bug c++/53707] compiler generates wrong code

2012-06-18 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #5 from Rafał Mużyło 2012-06-18 09:46:17 UTC --- The wrong code here seems to be 'n' treated as a constant - there was a bug (regarding freeciv, IIRC) of a similar case for an older gcc version. As for gcc 4.6.4, when will it be rele

[Bug c++/53707] compiler generates wrong code

2012-06-18 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 Richard Guenther changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed|

[Bug c++/53707] compiler generates wrong code

2012-06-17 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 Rafał Mużyło changed: What|Removed |Added Attachment #27643|0 |1 is obsolete|

[Bug c++/53707] compiler generates wrong code

2012-06-17 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #2 from Rafał Mużyło 2012-06-17 13:05:20 UTC --- Created attachment 27643 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27643 preprocessed sources triggering the bug

[Bug c++/53707] compiler generates wrong code

2012-06-17 Thread galtgendo at o2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707 --- Comment #1 from Rafał Mużyło 2012-06-17 13:03:27 UTC --- Created attachment 27642 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27642 -Wall warnings Attaching '-Wall' warnings for completeness. Note, that gcc 4.7.1 generates good code