Bug#173513: [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
--- Comment #18 from jamborm at gcc dot gnu dot org 2008-04-01 14:50 --- I'm now working on a proper fix. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added CC||jamborm at gcc dot gnu dot | |org AssignedTo|unassigned at gcc dot gnu |jamborm at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2006-03-01 02:53:11 |2008-04-01 14:50:54 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079 --- You are receiving this mail because: --- You reported the bug, or are watching the reporter. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#173513: [Bug tree-optimization/3713] Pointers to functions or member functions are not folded or inlined
--- Comment #16 from jamborm at gcc dot gnu dot org 2008-04-16 13:27 --- I'm now working on inlining of indirect calls (PR 9079) and intend to allow for inlining of calls through member pointers too. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |jamborm at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2006-03-11 06:23:54 |2008-04-16 13:27:21 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3713 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#173513: [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
--- Comment #19 from jamborm at gcc dot gnu dot org 2008-07-25 17:51 --- As of revision 138092 we are handling this much better. The example in bug description gets inlined at -O2 even with -fno-early-inlining. The example in comment #10 does not work as expected yet. The new edge is discovered but the always_inline attribute is disregarded and the inlined does not decide to inline it on its own. I will try to fix this but it should be noted that few guarantees can be made about indirect calls to always_inline functions and about always_inline functions which have their addresses taken in general. As far as the third example in comment #11 is concerned, the only problem is loading the target function from the array. The loaded value is not recognized to be constant early enough to be considered for inlining. That is really a separate issue though, quite different from the one originally described. I will have a look at what we can do earlier but I will close the bug if this is the only outstanding issue and I don't see an easy fix. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079 --- You are receiving this mail because: --- You reported the bug, or are watching the reporter. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#173513: [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
--- Comment #20 from jamborm at gcc dot gnu dot org 2008-10-22 15:09 --- OK, here is the status regarding the trunk (4.4) and the test cases posted here: 1. The test case in the bug description now works in the sense that funk is inlined even when not performing early inlining because both indirect inlining and copy propagation can help the inliner do this. 2. When compiling the code from comment #10 with indirect inlining turned on (default on -O2) we end up with (taken from the "optimized" tree dump): a (int x) { : if (x != 0) goto ; else goto ; : f (); [tail call] goto ; : f (); [tail call] : return; } Which obviously might be optimized even further but this is no longer an inlining issue. 3. Finally, let's look at code from comment #11. The function main still retains one call to foo(), specifically the one that came from function call(). The reason is that early cpp does not see the index being constant and thus does not replace the array_ref directly with the constant. Arguments could be made that cpp should be run few more times at various places (after ipa-cp, for example) but IMHO pass ordering would need bigger justification than this artificial example and this would be very difficult to implement while also retaining the three phase division of ipa passes for lto. Because we are done with all three examples as far as inlining is concerned, I think this is fixed. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079 --- You are receiving this mail because: --- You reported the bug, or are watching the reporter. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#173513: [Bug tree-optimization/3713] Pointers to functions or member functions are not folded or inlined
--- Comment #17 from jamborm at gcc dot gnu dot org 2009-08-06 12:22 --- Note to self: PR 40874 is related. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3713 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42703] [4.5 Regression] ICE in generate_subtree_copies with out of bounds array access
--- Comment #5 from jamborm at gcc dot gnu dot org 2010-01-12 21:05 --- I would say that the dd.c[4] access into an array that is four chars long has undefined behavior. It is also the reason why build_ref_for_offset cannot find a suitable array element for it, because there is none. Because we should not ICE anyway I guess I'll resort to pro-actively checking that we can create an access to the original piece of the aggregate when deciding what replacements to create. (That is a bit pity as the asserts nicely checked that the function worked in the cases when it really should.) Another option (as Andrew has just suggested on IRC) would be to turn such things into __builtin_trap(). That would teach them not to write code like this, . -- jamborm at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |jamborm at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2010-01-12 14:13:18 |2010-01-12 21:05:19 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42703 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42703] [4.5 Regression] ICE in generate_subtree_copies with out of bounds array access
--- Comment #6 from jamborm at gcc dot gnu dot org 2010-01-13 11:07 --- Patch posted to the mailing list: http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00562.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42703 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42703] [4.5 Regression] ICE in generate_subtree_copies with out of bounds array access
--- Comment #7 from jamborm at gcc dot gnu dot org 2010-01-13 15:37 --- Subject: Bug 42703 Author: jamborm Date: Wed Jan 13 15:37:37 2010 New Revision: 155863 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155863 Log: 2010-01-13 Martin Jambor PR tree-optimization/42703 * tree-sra.c (analyze_access_subtree): Check that we can build a reference to the original data within the aggregate. * testsuite/gcc.c-torture/compile/pr42703.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr42703.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-sra.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42703 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42703] [4.5 Regression] ICE in generate_subtree_copies with out of bounds array access
--- Comment #8 from jamborm at gcc dot gnu dot org 2010-01-13 15:38 --- Fixed. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42703 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42706] [4.5 Regression] ICE in gimple_op, at gimple.h:1634, (IPA SRA)
--- Comment #4 from jamborm at gcc dot gnu dot org 2010-01-13 17:26 --- Mine. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |jamborm at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2010-01-12 15:55:06 |2010-01-13 17:26:51 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42706 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42706] [4.5 Regression] ICE in gimple_op, at gimple.h:1634, (IPA SRA)
--- Comment #5 from jamborm at gcc dot gnu dot org 2010-01-14 16:07 --- Patch posted to the mailing list: http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00667.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42706 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42706] [4.5 Regression] ICE in gimple_op, at gimple.h:1634, (IPA SRA)
--- Comment #6 from jamborm at gcc dot gnu dot org 2010-01-14 18:00 --- Subject: Bug 42706 Author: jamborm Date: Thu Jan 14 18:00:34 2010 New Revision: 155911 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155911 Log: 2010-01-14 Martin Jambor PR tree-optimization/42706 * tree-sra.c (encountered_recursive_call): New variable. (encountered_unchangable_recursive_call): Likewise. (sra_initialize): Initialize both new variables. (callsite_has_enough_arguments_p): New function. (scan_function): Call decl and flags check only for IPA-SRA, check whether there is a recursive call and whether it has enough arguments. (all_callers_have_enough_arguments_p): New function. (convert_callers): Look for recursive calls only when encountered_recursive_call is set. (ipa_early_sra): Bail out either if !all_callers_have_enough_arguments_p or encountered_unchangable_recursive_call. * testsuite/gcc.dg/ipa/pr42706.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/ipa/pr42706.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-sra.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42706 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
[Bug tree-optimization/42706] [4.5 Regression] ICE in gimple_op, at gimple.h:1634, (IPA SRA)
--- Comment #7 from jamborm at gcc dot gnu dot org 2010-01-14 18:02 --- Fixed. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42706 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. -- To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org