[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 Richard Biener changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #25 from Richard Biener --- This has been fixed with moving almost all mathfn foldings from builtins.c to match.pd.
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #24 from Richard Biener --- (In reply to ktkachov from comment #23) > (In reply to Richard Biener from comment #22) > > (In reply to ktkachov from comment #21) > > > Created attachment 34215 [details] > > > Link errors output for aarch64 > > > > > > > Which one exactly? That is, what is the failing link output? > > > > > > All of them AFAICS. I'm attaching the link failures log. > > > > > > The test PASSes at -O2 -flto and -O2 -flto -flto-partition=none > > > > > > but FAILs on all other torture options > > > > With a cross to aarch64-linux and compiling with -O1+ -ffast-math the > > result is as expected (optimized to empty functions). How exactly > > do you configure? I used > > > > /space/rguenther/src/svn/trunk2/configure --target=aarch64-suse-linux > > --enable-languages=c,c++,fortran --enable-checking > > Hmmm... My compiler is a bare-metal one: aarch64-none-elf (and I still see > these failures). > > With an aarch64-none-linux-gnu compiler the testcase works fine... I have opened PR64313 for this regression.
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #23 from ktkachov at gcc dot gnu.org --- (In reply to Richard Biener from comment #22) > (In reply to ktkachov from comment #21) > > Created attachment 34215 [details] > > Link errors output for aarch64 > > > > > Which one exactly? That is, what is the failing link output? > > > > All of them AFAICS. I'm attaching the link failures log. > > > > The test PASSes at -O2 -flto and -O2 -flto -flto-partition=none > > > > but FAILs on all other torture options > > With a cross to aarch64-linux and compiling with -O1+ -ffast-math the > result is as expected (optimized to empty functions). How exactly > do you configure? I used > > /space/rguenther/src/svn/trunk2/configure --target=aarch64-suse-linux > --enable-languages=c,c++,fortran --enable-checking Hmmm... My compiler is a bare-metal one: aarch64-none-elf (and I still see these failures). With an aarch64-none-linux-gnu compiler the testcase works fine...
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #22 from Richard Biener --- (In reply to ktkachov from comment #21) > Created attachment 34215 [details] > Link errors output for aarch64 > > > Which one exactly? That is, what is the failing link output? > > All of them AFAICS. I'm attaching the link failures log. > > The test PASSes at -O2 -flto and -O2 -flto -flto-partition=none > > but FAILs on all other torture options With a cross to aarch64-linux and compiling with -O1+ -ffast-math the result is as expected (optimized to empty functions). How exactly do you configure? I used /space/rguenther/src/svn/trunk2/configure --target=aarch64-suse-linux --enable-languages=c,c++,fortran --enable-checking
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #21 from ktkachov at gcc dot gnu.org --- Created attachment 34215 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34215&action=edit Link errors output for aarch64 > Which one exactly? That is, what is the failing link output? All of them AFAICS. I'm attaching the link failures log. The test PASSes at -O2 -flto and -O2 -flto -flto-partition=none but FAILs on all other torture options
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #20 from rguenther at suse dot de --- On Mon, 8 Dec 2014, ktkachov at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 > > ktkachov at gcc dot gnu.org changed: > >What|Removed |Added > > CC||ktkachov at gcc dot gnu.org > > --- Comment #19 from ktkachov at gcc dot gnu.org --- > (In reply to Richard Biener from comment #18) > > Author: rguenth > > Date: Wed Dec 3 11:55:14 2014 > > New Revision: 218308 > > > > URL: https://gcc.gnu.org/viewcvs?rev=218308&root=gcc&view=rev > > Log: > > 2014-12-03 Richard Biener > > > > PR middle-end/14541 > > * builtins.c (fold_builtin_logarithm): Implement simplifications ... > > * match.pd: ... here as patterns. > > > > Modified: > > trunk/gcc/ChangeLog > > trunk/gcc/builtins.c > > trunk/gcc/match.pd > > With this commit the builtin-explog-1.c test stops folding the builtins on > aarch64 (and consequently FAILs) Which one exactly? That is, what is the failing link output?
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 ktkachov at gcc dot gnu.org changed: What|Removed |Added CC||ktkachov at gcc dot gnu.org --- Comment #19 from ktkachov at gcc dot gnu.org --- (In reply to Richard Biener from comment #18) > Author: rguenth > Date: Wed Dec 3 11:55:14 2014 > New Revision: 218308 > > URL: https://gcc.gnu.org/viewcvs?rev=218308&root=gcc&view=rev > Log: > 2014-12-03 Richard Biener > > PR middle-end/14541 > * builtins.c (fold_builtin_logarithm): Implement simplifications ... > * match.pd: ... here as patterns. > > Modified: > trunk/gcc/ChangeLog > trunk/gcc/builtins.c > trunk/gcc/match.pd With this commit the builtin-explog-1.c test stops folding the builtins on aarch64 (and consequently FAILs)
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #18 from Richard Biener --- Author: rguenth Date: Wed Dec 3 11:55:14 2014 New Revision: 218308 URL: https://gcc.gnu.org/viewcvs?rev=218308&root=gcc&view=rev Log: 2014-12-03 Richard Biener PR middle-end/14541 * builtins.c (fold_builtin_logarithm): Implement simplifications ... * match.pd: ... here as patterns. Modified: trunk/gcc/ChangeLog trunk/gcc/builtins.c trunk/gcc/match.pd
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 Richard Biener changed: What|Removed |Added Assignee|pinskia at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #17 from Richard Biener --- I have a patch for fold_builtin_logarithm. But as I understand this PR basically asks for "everything". A few more cases are already implemented on the branch.
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #16 from Richard Biener --- (for logfn (BUILT_IN_LOGF BUILT_IN_LOG BUILT_IN_LOGL) expfn (BUILT_IN_EXPF BUILT_IN_EXP BUILT_IN_EXPL) (simplify (logfn (expfn @0)) (if (flag_unsafe_math_optimizations) @0))) with the still somewhat awkward syntax, patch for proposed better one is not yet ready but would look like (define_operator_list log (BUILT_IN_LOGF BUILT_IN_LOG BUILT_IN_LOGL)) (define_operator_list exp (BUILT_IN_EXPF BUILT_IN_EXP BUILT_IN_EXPL)) (simplify (log (exp @0)) (if (flag_unsafe_math_optimizations) @0))) thus the 'for' would be implicit. Note that fold_builtin_logarithm does handle some more cases. The match-and-simplify branch already covers quite some patterns in match-builtins.def (but not the above). I'll see if I can take the syntax patch (I was waiting for that so not to merge the "ugly" syntax).
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 Bug 14541 depends on bug 15459, which changed state. Bug 15459 Summary: [meta-bug] there should be a tree combiner like the rtl one https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15459 What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 Andrew Pinski changed: What|Removed |Added Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |pinskia at gcc dot gnu.org |gnu.org | --- Comment #15 from Andrew Pinski 2012-02-12 09:23:28 UTC --- I will implement this combing in forwprop (since that is where we are doing all the combing optimizations now).
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
--- Comment #14 from pinskia at gcc dot gnu dot org 2006-11-26 08:15 --- *** Bug 29985 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||ubizjak at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541
[Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-12 21:26 --- It might be a while for me to rewrite the tree combiner so unassigning for now. -- What|Removed |Added AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu |org |dot org Status|ASSIGNED|NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541